make_system_models: Make system models for a demographic account

Description Usage Arguments Value Examples

View source: R/make_system_models.R

Description

Make system models for population, deaths, and births, for a demographic account

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
make_system_models(
  expected_popn,
  mort_rates,
  fert_rates,
  time_trend_popn = TRUE,
  sd_intercept = 0,
  sd_time = 0,
  sd_agesex = 0,
  scale_sd_popn = 1,
  scale_sd_rates = 0
)

Arguments

expected_popn

A Counts array giving expected population counts by age and sex. Typically created using functions make_stationary_popn, or make_stable_popn.

mort_rates

A Values array giving mortality rates by age and sex.

fert_rates

A Values array giving mean fertility rates by age and sex. Typically generated using function make_stationary_fert_rates.

time_trend_popn

Whether to use random walk model for the time effect in population. Defaults to TRUE.

sd_intercept

The standard deviation term to be used in priors for the intercept.

sd_time

The standard deviation term to be used in exchangeable priors for time.

sd_agesex

The standard deviation term to be used in priors for age-sex or age-sex-triangle interactions.

scale_sd_popn

The scale to be used in the prior for standard deviation in the prior model for population.

scale_sd_rates

The scale to be used in the priors for standard deviation in prior models for mortality and fertility rates.

Value

A list of three model specifications.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Lx <- dembase::Counts(Lx_west[ , , 20])
mort_rates <- dembase::Values(mx_west[ , , , 20])
propn_age_fert <- dembase::Values(propn_age_fert_booth)
expected_popn <- make_stationary_popn(popn_size = 100,
                                      Lx = Lx,
                                    sex_ratio = 105)
fert_rates <- make_stationary_fert_rates(Lx = Lx,
                                         propn_age_fert = propn_age_fert,
                                         sex_ratio = 105)
make_system_models(expected_popn = expected_popn,
                   mort_rates = mort_rates,
                   fert_rates = fert_rates)

johnrbryant/agesim documentation built on Dec. 31, 2021, 11:56 a.m.