This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{mathspec} | |
\usepackage{fontspec,xltxtra,xunicode} | |
\defaultfontfeatures{Mapping=tex-text} | |
\setromanfont[Mapping=tex-text]{Warnock Pro Light} | |
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Myriad Pro} | |
\setmonofont[Scale=MatchLowercase]{Andale Mono} | |
\setmathfont(Greek,Latin,Digits){Warnock Pro Light} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\setmainfont[ | |
UprightFeatures = { SmallCapsFont = {Andralis ND SC} }, | |
BoldFeatures = { SmallCapsFont = {Andralis ND SC Bold} }, | |
ItalicFeatures = { SmallCapsFont = {Andralis ND SC Italic} }, | |
BoldItalicFeatures = { SmallCapsFont = {Andralis ND SC Bold Italic} }, | |
]{Andralis ND OsF} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyx import * | |
import numpy as np | |
import scipy as sp | |
def null_bernoulli(top,bot,nint): | |
tint = top*bot | |
zeroes = tint-nint | |
## We only return a matrix with no non-interacting species | |
hasNull = True | |
trials = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gfreq = function(p) list(AA=p^2,Aa=2*p*(1-p),aa=(1-p)^2) | |
mfit = function(p,fit) | |
{ | |
with(as.list(fit),{ | |
mf = (p^2)*wAA+(2*p*(1-p)*wAa)+((1-p)^2)*waa | |
return(mf) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy as sp | |
from scipy.weave import inline | |
def along2Darray(rows,cols): | |
arr = np.zeros((rows,cols)) | |
code = """ | |
int Pos; | |
for(int Row = 0; Row < rows; Row++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def COFM(comat,normal=True): | |
CoFreq = [] | |
for sp1 in xrange(len(comat)-1): | |
for sp2 in xrange(sp1,len(comat)): | |
NCo = 0 | |
for nsite in xrange(len(comat[0])): | |
if comat[sp1][nsite]*comat[sp2][nsite] > 0: | |
NCo += 1 | |
if normal: | |
NCo /= len(comat[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mat = matrix(abs(round(rnorm(100,15,8),0))+1,10) | |
diag(mat) = 0 | |
print(mat) | |
permat = function(mat) | |
{ | |
mat[lower.tri(mat)+upper.tri(mat)==1] = sample(mat[lower.tri(mat)+upper.tri(mat)==1],replace=FALSE) | |
return(mat) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{MnSymbol} | |
\usepackage[mathlf,textlf,loosequotes]{MinionPro} | |
\usepackage[T1]{fontenc} | |
\usepackage[utf8]{inputenc} | |
\usepackage{textcomp} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import networkx as nx | |
import scipy as sp | |
import numpy as np | |
class comm: | |
""" | |
A CLASS FOR COMMUNITIES | |
pos : tuple with the spatial position | |
id : the name of the community |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
import networkx as nx | |
import numpy as np | |
import matplotlib.pyplot as plt | |
Patches = 100 # Number of patches | |
P_ext = 0.01 # Probability of extinction (e) | |
P_col = 0.014 # Probability of colonization (c) |
OlderNewer