Learn R Programming

StMoMo

StMoMo (Stochastic Mortality Modelling) is an R package providing functions to specify and fit stochastic mortality models including the Lee-Carter models, the CBD model, the APC model and many other (possibly new) models. The package also includes tools for analysing the goodness of fit of the models and performing mortality projections and simulations.

An overview of the usage and facilities of StMoMo is described in the working paper Andrés M. Villegas, Pietro Millossovich, Vladimir K. Kaishev. “StMoMo: An R Package for Stochastic Mortality Modelling”

Installation:

To install the stable version on R CRAN:

    install.packages("StMoMo")

To install the latest development version:

    install.packages("devtools")
    devtools::install_github("amvillegas/StMoMo")

License:

This package is free and open source software, licensed under GPL (>= 2)

If you are interested in the package feel free to email andresmauriciovillegas@gmail.com or track development at http://github.com/amvillegas/StMoMo

Copy Link

Version

Install

install.packages('StMoMo')

Monthly Downloads

786

Version

0.4.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Andres Villegas

Last Published

April 13th, 2018

Functions in StMoMo (0.4.1)

extractCoefficientsFromGnm

Extract the model coefficient
fitted.fitStMoMo

Compute fitted values for a Stochastic Mortality Model
computeDevianceBinomial

Binomial deviance
m8

Create an M8 type extension of the Cairns-Blake-Dowd mortality model
mrwd

Fit a Multivariate Random Walk with Drift
genWeightMat

Generate weight matrix
logLik.fitStMoMo

Log-Likelihood of a fitStMoMo object
getMinimalFitStMoMo

Extract a lighter version of a fitted Stochastic Mortality Model
forecast.fitStMoMo

Forecast mortality rates using a Stochastic Mortality Model
fit

Generic for fitting a Stochastic Mortality Model
genPoissonResBootSamples

Generate Poisson residual bootstrap sample
forecast.iarima

Forecast independent arima series
genPoissonSemiparametricBootSamples

Generate Poisson semiparametric bootstrap samples
logit

Logit function logit computes the logit function
forecast.mrwd

Forecast a Multivariate Random Walk with Drift
m6

Create an M6 type extension of the Cairns-Blake-Dowd mortality model
genBinomialResBootSamples

Generate Binomial residual bootstrap sample
iarima

Fit independent arima series to a multivariate time series
predict.fitStMoMo

Predict method for Stochastic Mortality Models fits
lc

Create a Lee-Carter model
invlogit

Inverse Logit function invlogit computes the inverse logit function
genBinomialSemiparametricBootSamples

Generate Binomial semiparametric bootstrap samples
predictLink

Compute the link for a given mortality models
plot.bootStMoMo

Plot bootstrapped parameters of a Stochastic Mortality Model
plot.fitStMoMo

Plot fitted parameters from a stochastic mortality model
simulate.bootStMoMo

Simulate future sample paths from a Bootstrapped Stochastic Mortality Model
initial2central

Transform StMoMoData from initial to central exposures
m7

Create an M7 type extension of the Cairns-Blake-Dowd mortality model
simulate.fitStMoMo

Simulate future sample paths from a Stochastic Mortality Model
plotParameterFan

Plot fanchart of the parameters
poissonRes2death

Map poisson deviance residuals into deaths
plot.forStMoMo

Plot a forecast from a Stochastic Mortality Model
processStartValues

Process the initial parameter supplied by the user
residuals.fitStMoMo

Extract deviance residuals of a Stochastic Mortality Model
plot.resStMoMo

Plot the residuals of a Stochastic Mortality Model
rh

Create a Renshaw and Haberman (Lee-Carter with cohorts) mortality model
simulate.iarima

Simulate independent arima series
simulate.mrwd

Simulate a Multivariate Random Walk with Drift
scatterplotAPC

Do a scatter plot of a matrix according to age-period-cohorts
central2initial

Transform StMoMoData from central to initial exposures
bootstrap

Generic method for bootstrapping a fitted Stochastic Mortality Model
StMoMoData

Create StMoMoData object from demogdata object
bootstrap.fitStMoMo

Bootstrap a fitted Stochastic Mortality Model
StMoMo

Create a new Stochastic Mortality Model
arima.string

Copy of unexported function arima.string from forecast
cbd

Create a Cairns-Blake-Dowd mortality model
apc

Create an Age-Period-Cohort mortality model
binomRes2q

Map Binomial deviance residuals into deaths
EWMaleData

England and Wales male mortality data
coef.fitStMoMo

Extract coefficients from a fitted Stochastic Mortality Model
fit.StMoMo

Fit a Stochastic Mortality Model
computeLogLikPoisson

Compute Poisson loglikelihod
computeDeviancePoisson

Compute Poisson deviance
computeLogLikBinomial

Compute Binomial loglikelihod
extractCohort

Extract cohort from an age-period array
fit.rh

Fit a Renshaw and Haberman (Lee-Carter with cohorts) mortality model