R/stage_at_death_dist.R
stage_at_death_dist.Rd
Calculates the expected distribution of deaths across stages for a cohort
governed by the survival/transition submatrix U
of a matrix population
model. The result can be interpreted as the probability of dying in each
stage.
stage_at_death_dist(matU, start = NULL)
A square numeric matrix giving the survival/transition (\(U\)) submatrix of a stage-based (Lefkovitch) matrix population model.
Optional numeric vector of length \(n\) giving the initial
cohort distribution across stages. It will be rescaled to sum to 1.
Defaults to a uniform distribution if NULL
.
A numeric vector giving the expected contribution of each stage to
deaths. Names are taken from rownames(U)
when available.
This function uses the fundamental matrix of the Markov chain implied by
U
to estimate the total expected time spent in each stage, then
combines this with per-stage death probabilities. The output describes where
in the life cycle deaths occur, given a specified starting stage
distribution.
Results may be misleading if U
includes reproduction or if any column
sums exceed 1. Use only the survival/transition submatrix. The calculation
also assumes that all stages are transient (i.e. eventual death is certain).
Other life history traits:
entropy_d()
,
entropy_k()
,
entropy_k_age()
,
entropy_k_stage()
,
gen_time()
,
life_elas()
,
life_expect_mean()
,
longevity()
,
net_repro_rate()
,
repro_maturity
,
shape_rep()
,
shape_surv()
data(mpm1)
# Uniform starting cohort (default)
stage_at_death_dist(mpm1$matU)
#> seed small medium large dormant
#> 0.1888889 0.1575102 0.2247635 0.1293947 0.2994426
# Starting entirely in stage 1
stage_at_death_dist(mpm1$matU, start = c(1, 0, 0, 0, 0))
#> Error in stage_at_death_dist(mpm1$matU, start = c(1, 0, 0, 0, 0)): object 'n' not found
# Starting with the SSD (requires the full A matrix)
matA <- mpm1$matU + mpm1$matF
ssd <- popdemo::eigs(matA, "ss")
stage_at_death_dist(mpm1$matU, start = ssd)
#> Error in stage_at_death_dist(mpm1$matU, start = ssd): object 'n' not found