strata_to_residency_proportion | R Documentation |
If input is given as a vector of population sizes per-strata, lumped over patches, and a separate matrix whose columns describe how each strata is distributed over patches, this function calculates the residency matrix and population size for the overall stratification of both residency and strata.
strata_to_residency_proportion(H_strata, J_strata)
H_strata |
a vector of population size by strata |
J_strata |
a matrix whose columns sum to one giving the distribution of strata (columns) populations over patches (rows) |
a list with three elements:
assignment_indices
: provides a mapping from patch (rows) and strata (columns)
into the "unrolled" vector H
J
: the residency matrix mapping elements in H
to patches
H
: the overall population distribution over strata and patches
# taken from package tests J <- matrix( c(0.3, 0.5, 0.2, 0.1, 0.6, 0.3), nrow = 3, ncol = 2, byrow = FALSE ) H <- c(50, 60) # get the overall assignment of strata (cols) across patches (rows) H_overall <- J %*% diag(H) residency <- strata_to_residency_proportion(H_strata = H, J_strata = J)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.