ccmppR | R Documentation |
Simulate cohort component population projection
ccmppR(basepop, sx, fx, gx, srb, age_span, fx_idx) ccmpp_leslieR(basepop, sx, fx, gx, srb, age_span, fx_idx)
basepop |
vector of baseline population size. |
sx |
a matrix of survivorship probabilities. |
fx |
a matrix of fertility rates, only amongst fertile ages. |
gx |
a matrix of proportion of migrants during projection period. |
srb |
a vector of sex ratio at birth. |
age_span |
the interval for age and projection time step. |
fx_idx |
first in |
Arguments 'sx', 'fx', and 'gx' are matrices with one column for each projection period, and 'srb' is a vector of length number of projection periods.
The number of age groups in the deaths array are one greater than then number of age groups because deaths are counted separately for those ageing into the open ended age group and survivors in the open ended age group.
'ccmppR()' returns a list with matrices for population, (cohort) deaths, births by age, number of infants, and migrations.
'ccmpp_leslieR()' simulates the same population projection using a Leslie matrix formulation and returns a matrix of population. This is exactly equal to 'population' returned by 'ccmppR()' (see examples).
library(popReconstruct) data(burkina_faso_females) bf_basepop <- as.numeric(burkina.faso.females$baseline.pop.counts) bf_sx <- burkina.faso.females$survival.proportions bf_fx <- burkina.faso.females$fertility.rates[4:10, 1] bf_gx <- burkina.faso.females$migration.proportions bf_srb <- rep(1.05, ncol(burkina.faso.females$survival.proportions)) pop_leslie <- ccmpp_leslieR(basepop = bf_basepop, sx = bf_sx, fx = bf_fx, gx = bf_gx, srb = bf_srb, age_span = 5, fx_idx = 4) pop_proj <- ccmppR(basepop = bf_basepop, sx = bf_sx, fx = bf_fx, gx = bf_gx, srb = bf_srb, age_span = 5, fx_idx = 4) all(pop_leslie == pop_proj$population)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.