R/scale_mpm_to_lambda1.R
scale_mpm_to_lambda1.RdScales a matrix population model (MPM) so that the dominant eigenvalue
(\(\lambda\)) of the full projection matrix equals 1. The function accepts
either a full projection matrix (matA) or a set of component matrices
consisting of the survival component (matU) plus at least one
reproductive component (matF and/or matC).
scale_mpm_to_lambda1(matU = NULL, matF = NULL, matC = NULL, matA = NULL)The survival component of a matrix population model (i.e., a square projection matrix reflecting survival-related transitions; e.g., progression, stasis, and retrogression). Required when using component inputs.
The sexual reproduction component of a matrix population model.
Optional if matC is supplied. If omitted while matC is
supplied, it is assumed to be a zero matrix.
The clonal reproduction component of a matrix population model.
Optional if matF is supplied. If omitted while matF is
supplied, it is assumed to be a zero matrix.
The full projection matrix of a matrix population model.
Optional if component matrices are supplied. If supplied together with
components, it must equal matU + matF + matC.
A list with six elements:
The scaled full projection matrix.
The scaled survival matrix. Returned as NULL if only
matA is supplied.
The scaled sexual reproduction matrix. Returned as NULL
if only matA is supplied.
The scaled clonal reproduction matrix. Returned as NULL
if only matA is supplied.
The dominant eigenvalue of the original projection matrix.
The dominant eigenvalue of the scaled projection matrix.
When component matrices are used, matU must be supplied
together with at least one of matF or matC. Missing
reproductive components are treated as zero matrices of the appropriate
dimension.
Other transformation:
is_leslie_matrix(),
leslie_collapse(),
mpm_collapse(),
mpm_rearrange(),
mpm_split(),
mpm_standardize(),
name_stages(),
repro_stages(),
standard_stages()
data(mpm1)
# scale from the full projection matrix
matA <- mpm1$matU + mpm1$matF
scale_mpm_to_lambda1(matA = matA)
#> $matA
#> seed small medium large dormant
#> seed 0.08920313 0.00000000 15.96736076 40.67662853 0.00000000
#> small 0.04460157 0.10704376 0.08920313 0.00000000 0.00000000
#> medium 0.00000000 0.31221096 0.10704376 0.20516721 0.10704376
#> large 0.00000000 0.02676094 0.24976877 0.46385629 0.08920313
#> dormant 0.00000000 0.00000000 0.14272501 0.09812345 0.15164533
#>
#> $matU
#> NULL
#>
#> $matF
#> NULL
#>
#> $matC
#> NULL
#>
#> $lambda_original
#> [1] 1.121037
#>
#> $lambda_scaled
#> [1] 1
#>
# scale from component matrices, assuming no clonal reproduction
scale_mpm_to_lambda1(matU = mpm1$matU, matF = mpm1$matF)
#> $matA
#> seed small medium large dormant
#> seed 0.08920313 0.00000000 15.96736076 40.67662853 0.00000000
#> small 0.04460157 0.10704376 0.08920313 0.00000000 0.00000000
#> medium 0.00000000 0.31221096 0.10704376 0.20516721 0.10704376
#> large 0.00000000 0.02676094 0.24976877 0.46385629 0.08920313
#> dormant 0.00000000 0.00000000 0.14272501 0.09812345 0.15164533
#>
#> $matU
#> seed small medium large dormant
#> seed 0.08920313 0.00000000 0.00000000 0.00000000 0.00000000
#> small 0.04460157 0.10704376 0.08920313 0.00000000 0.00000000
#> medium 0.00000000 0.31221096 0.10704376 0.20516721 0.10704376
#> large 0.00000000 0.02676094 0.24976877 0.46385629 0.08920313
#> dormant 0.00000000 0.00000000 0.14272501 0.09812345 0.15164533
#>
#> $matF
#> seed small medium large dormant
#> seed 0 0 15.96736 40.67663 0
#> small 0 0 0.00000 0.00000 0
#> medium 0 0 0.00000 0.00000 0
#> large 0 0 0.00000 0.00000 0
#> dormant 0 0 0.00000 0.00000 0
#>
#> $matC
#> seed small medium large dormant
#> seed 0 0 0 0 0
#> small 0 0 0 0 0
#> medium 0 0 0 0 0
#> large 0 0 0 0 0
#> dormant 0 0 0 0 0
#>
#> $lambda_original
#> [1] 1.121037
#>
#> $lambda_scaled
#> [1] 1
#>