cov_matrix | R Documentation |
Calculate the variance-covariance matrix for the vital rates of a series of population projection matrices.
cov_matrix(Aobj)
Aobj |
A matrix where each row is the column-wise vectorization of a population projection matrix. |
The diagonal entries of the variance-covariance matrix give the variance of the entries in each index of the matrix. The off-diagonal entries of the variance-covariance matrix give the covariance of entries in each index of the matrix. The variance-covariance matrix is symmetrical, and the covariance of a given pair of vital rates is the sum of the two corresponding indices.
The variance-covariance matrix for the vital rates of the population
projection matrices. If the dimensions of each matrix in Aobj
are n-by-n,
then the variance-covariance matrix will have dimensions n^2-by-n^2.
A1<- matrix(data=c(0,0.8,0, 0,0,0.7, 5,0,0.2), nrow=3, ncol=3)
A2<- matrix(data=c(0,0.9,0, 0,0,0.5, 4,0,0.3), nrow=3, ncol=3)
A3<- matrix(data=c(0,0.4,0, 0,0,0.6, 6,0,0.25), nrow=3, ncol=3)
A_all<- collapse_mat_list(list(A1, A2, A3))
covmat<- cov_matrix(A_all)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.