gompertz: Create a vector of mortality rates generated by a...

View source: R/gompertz.R

gompertzR Documentation

Create a vector of mortality rates generated by a heterogeneous gompertz model

Description

This function produces a vector of mortality rates for a heterogeneous population containing n sub-populations.

Usage

gompertz(rho0, m0, beta, age_vec)

Arguments

rho0

Numeric vector of length n of initial fractions of sub-populations within total population.

m0

Numeric vector of length n of initial sub-population mortality rates.

beta

Numeric vector of length n of sub-population rates of mortality dynamics.

age_vec

Numeric vector of ages from 0 to upper age limit of population, \omega.

Value

Outputs a numeric vector of mortality rates for the heterogeneous population of length 0:\omega.

Examples

age_vec <- 0:110; rho0 <- c(0.5, 0.5); m0 <- c(0.05, 0.02); beta <- (0.039, 0.039)
mrates <- gompertz(rho0, m0, beta, age_vec)
plot(age_vec, mrates)

pachristopher/projectRpkg documentation built on Nov. 24, 2022, 8:28 p.m.