Simulate population projections given initial population in each stage and survival, ageing, and birth process matrices. Survival can vary by period (e.g., month) and year, birth can vary by year, and ageing is constant. This model assumes that survival occurs at the end of each period and survival, ageing and birth occur at the end of each year, in that order. The dimensions of birth, age and survival process matrices must be identical to the length of the initial population vector.
bbs_population(population_init, birth, age, survival, stochastic = TRUE)
A vector of the initial population for each stage.
An array of the birth matrices (output of bbs_matrix_birth_year()
).
An age process matrix (output of bbs_matrix_age).
An array of the survival matrices (output of bbs_matrix_survival_period()
).
A flag indicating whether to include demographic stochasticity.
A matrix of the population by stage and period.
pop0 <- c(100, 200)
survival <- bbs_survival(intercept = logit(c(0.95, 0.98)))
fecundity <- bbs_fecundity(intercept = c(NA, logit(0.4)))
survival_mat <- bbs_matrix_survival_period(survival$eSurvival)
birth_mat <- bbs_matrix_birth_year(fecundity$eFecundity)
age_mat <- bbs_matrix_age(c(2, 2))
x <- bbs_population(pop0,
birth = birth_mat,
age = age_mat,
survival = survival_mat
)