OPAG_nLx_warp_r: Warps a given stationary population into a stable population

View source: R/OPAG.R

OPAG_nLx_warp_rR Documentation

Warps a given stationary population into a stable population

Description

We take nLx as indicative of a stationary population age structure, then subject the population structure to long-term growth by a constant rate, r.

Usage

OPAG_nLx_warp_r(Lx1, Age_Lx1, r)

Arguments

Lx1

numeric vector of stationary population age structure in arbitrary integer age groups

Age_Lx1

integer vector of lower bounds of age groups of nLx

r

stable growth rate

Details

Lx1 could be any population structure of any scale, as long as you're comfortable assuming it's stationary and can be warped into stable. For the oldest ages, this is probably quite often an acceptable and useful approximation. The transformation is applied at the single-age scale, even if the input nLx is in wider (e.g. abridged) age groups. When needed, we reduce to single ages using (default) graduate_uniform(), then apply the transformation, then group back. This is innocuous if nLx is given in single ages. You may want to change method to "mono" or "pclm".

Value

numeric vector of the transformed nLx. Note, this vector sums to 1.

Examples

Lx  <- downloadnLx(NULL, "Spain","female",1971)
Age <- names2age(Lx)
r   <- .01
ai  <- age2int(Age)
## Not run: 
plot(Age, Lx/sum(Lx) / ai, type = 's',ylim = c(0,0.015))
lines(Age,OPAG_nLx_warp_r(Lx,Age,0.005)/ai,type='s',col = "red")
lines(Age,OPAG_nLx_warp_r(Lx,Age,-0.005)/ai,type='s',col = "blue")

## End(Not run)


timriffe/DemoTools documentation built on Oct. 14, 2024, 12:53 p.m.