powerlawA {miaSim} | R Documentation |
Where N is the an Interspecific Interaction matrix with values drawn from a normal distribution H the interaction strength heterogeneity drawn from a power-law distribution with the parameter alpha, and G the adjacency matrix of with out-degree that reflects the heterogeneity of the powerlaw. A scaling factor s may be used to constrain the values of the interaction matrix to be within a desired range. Diagonal elements of A are defined by the parameter d.
powerlawA(n.species, alpha = 3, stdev = 1, s = 0.1, d = -1, symmetric = FALSE)
n.species |
integer: the number of species |
alpha |
numeric: the power-law distribution parameter. Should be > 1.
(default: |
stdev |
numeric: the standard deviation parameter of the normal
distribution with mean 0 from which the elements of the nominal interspecific
interaction matrix N are drawn. (default: |
s |
numeric: scaling parameter with which the final global
interaction matrix A is multiplied. (default: |
d |
numeric: diagonal values, indicating self-interactions (use
negative values for stability). (default: |
symmetric |
logical: return a symmetric interaction matrix
(default: |
The interaction matrix A with n rows and n columns.
Gibson TE, Bashan A, Cao HT, Weiss ST, Liu YY (2016) On the Origins and Control of Community Types in the Human Microbiome. PLOS Computational Biology 12(2): e1004688. https://doi.org/10.1371/journal.pcbi.1004688
# Low interaction heterogeneity A_low <- powerlawA(n.species = 10, alpha = 3) # Strong interaction heterogeneity A_strong <- powerlawA(n.species = 10, alpha = 1.01)