Description Usage Arguments Details Value Author(s) References Examples
Create an ntimes
x nspecies
matrix with correlation rho,
standard deviation sigma, and mean mu
1 | correlated.matrix (rho = 0, sigma = 1, mu = 0, ntimes = 200, nspecies = 10)
|
rho |
Correlation between the columns of the matrix. This can be a single number describing
the correlation between all columns, or the upper triangular portion of a correlation
matrix describing the correlation between all pairs of columns. Default is |
sigma |
Standard deviation of the columns. Default is 1 |
mu |
Mean of the columns. Default is 0 |
ntimes |
Number of rows in the matrix. Default is 200 |
nspecies |
Number of columns in the matrix. Default is 10 |
This function is based on the Cholesky factorization method described by Legendre (2000).
Returns a named list containing the following:
rho |
Correlation(s) between the columns |
sigma |
Standard deviation of the columns |
mu |
Mean of the columns |
community |
|
Tarik C. Gouhier (tarik.gouhier@gmail.com)
Gouhier, T. C., F. Guichard, and A. Gonzalez. 2010. Synchrony and stability of food webs in metacommunities. The American Naturalist 175:E16-E34.
Legendre, P. 2000. Comparison of permutation methods for the partial correlation and partial mantel tests. Journal of Statistical Computation and Simulation 67:37-73.
1 2 3 4 5 6 7 | mat=correlated.matrix(rho=0.85, sigma=30, mu=10, nspecies=10)
# Check sd of each column
apply(mat$community, 2, sd)
# Check mean of each column
apply(mat$community, 2, mean)
# Check correlation of matrix
community.sync(mat$community)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.