R/mpm_collapse.R
mpm_collapse.Rd
Collapse a matrix population model to a smaller number of stages. For instance, to compare properties of multiple projection matrices with different numbers of stages, one might first collapse those matrices to a standardized set of stages (e.g., propagule, pre-reproductive, reproductive, and post-reproductive). The transition rates in the collapsed matrix are a weighted average of the transition rates from the relevant stages of the original matrix, weighted by the relative proportion of each stage class expected at the stable distribution.
mpm_collapse(matU, matF, matC = NULL, collapse)
The survival component of a matrix population model (i.e., a square projection matrix reflecting survival-related transitions; e.g., progression, stasis, and retrogression)
The sexual component of a matrix population model (i.e., a square projection matrix reflecting transitions due to sexual reproduction)
The clonal component of a matrix population model (i.e., a square
projection matrix reflecting transitions due to clonal reproduction).
Defaults to NULL
, indicating no clonal reproduction (i.e.,
matC
is a matrix of zeros).
A list giving the mapping between stages of the original
matrix and the desired stages of the collapsed matrix (e.g., list(1,
2:3, 4)
). Original stages may be passed as either indices or stage names
corresponding to stage index or name in matU
, matF
and
matC
). Names given to the elements of collapse
are used as
stage names in the new, collapsed matrix.
See Missing Stages for handling of NA
within collapse
.
A list with four elements:
Collapsed projection matrix
Survival component of the collapsed projection matrix
Sexual reproduction component of the collapsed projection matrix
Clonal reproduction component of the collapsed projection matrix
This method of collapsing a matrix population model preserves the equilibrium population growth rate (\(lambda\)) and relative stable distribution, but is not expected to preserve other traits such as relative reproductive values, sensitivities, net reproductive rates, life expectancy, etc.
The collapsed matrix will always be of dimension length(collapse)
,
even if one or more elements of the collapse
argument is NA
(corresponding to a desired stage of the collapsed matrix that is not present
in the original matrix). In the collapsed matrix, any row/column
corresponding to a missing stage will be coerced to NA
.
Salguero-Gomez, R. & Plotkin, J. B. 2010. Matrix dimensions bias demographic inferences: implications for comparative plant demography. The American Naturalist 176, 710-722. <doi:10.1086/657044>
Other transformation:
is_leslie_matrix()
,
leslie_collapse()
,
mpm_rearrange()
,
mpm_split()
,
mpm_standardize()
,
name_stages()
,
repro_stages()
,
standard_stages()
data(mpm1)
# check which stages reproductive
repro_stages(matR = mpm1$matF)
#> seed small medium large dormant
#> FALSE FALSE TRUE TRUE FALSE
# collapse reproductive stages (3 and 4) into single stage
mpm_collapse(
matU = mpm1$matU, matF = mpm1$matF,
collapse = list(1, 2, 3:4, 5)
)
#> $matA
#> [,1] [,2] [,3] [,4]
#> [1,] 0.10 0.00 28.54374157 0.00
#> [2,] 0.05 0.12 0.06157494 0.00
#> [3,] 0.00 0.38 0.53448771 0.22
#> [4,] 0.00 0.00 0.14078747 0.17
#>
#> $matU
#> [,1] [,2] [,3] [,4]
#> [1,] 0.10 0.00 0.00000000 0.00
#> [2,] 0.05 0.12 0.06157494 0.00
#> [3,] 0.00 0.38 0.53448771 0.22
#> [4,] 0.00 0.00 0.14078747 0.17
#>
#> $matF
#> [,1] [,2] [,3] [,4]
#> [1,] 0 0 28.54374 0
#> [2,] 0 0 0.00000 0
#> [3,] 0 0 0.00000 0
#> [4,] 0 0 0.00000 0
#>
#> $matC
#> [,1] [,2] [,3] [,4]
#> [1,] 0 0 0 0
#> [2,] 0 0 0 0
#> [3,] 0 0 0 0
#> [4,] 0 0 0 0
#>
# use stage names instead, and name stages in the collapsed matrix
mpm_collapse(
matU = mpm1$matU, matF = mpm1$matF,
collapse = list(
seed = "seed", vegetative = "small",
flowering = c("medium", "large"),
dormant = "dormant"
)
)
#> $matA
#> seed vegetative flowering dormant
#> seed 0.10 0.00 28.54374157 0.00
#> vegetative 0.05 0.12 0.06157494 0.00
#> flowering 0.00 0.38 0.53448771 0.22
#> dormant 0.00 0.00 0.14078747 0.17
#>
#> $matU
#> seed vegetative flowering dormant
#> seed 0.10 0.00 0.00000000 0.00
#> vegetative 0.05 0.12 0.06157494 0.00
#> flowering 0.00 0.38 0.53448771 0.22
#> dormant 0.00 0.00 0.14078747 0.17
#>
#> $matF
#> seed vegetative flowering dormant
#> seed 0 0 28.54374 0
#> vegetative 0 0 0.00000 0
#> flowering 0 0 0.00000 0
#> dormant 0 0 0.00000 0
#>
#> $matC
#> seed vegetative flowering dormant
#> seed 0 0 0 0
#> vegetative 0 0 0 0
#> flowering 0 0 0 0
#> dormant 0 0 0 0
#>