tests/testthat/test-make_stationary_fert_rates.R

context("make_stationary_fert_rates")

test_that("make_stationary_fert_rates gives net reproduction rates of 1", {
    Lx <- dembase::Counts(Lx_west[,,5])
    propn_age_fert = dembase::Values(propn_age_fert_booth)
    fert_rates <- make_stationary_fert_rates(Lx = Lx,
                                             propn_age_fert = propn_age_fert,
                                             sex_ratio = 110)
    NRR <- sum(fert_rates[, "Female"] * Lx[3:10 , "Female"])
    expect_equal(NRR, 1)
})
johnrbryant/agesim documentation built on Dec. 31, 2021, 11:56 a.m.