Skip to main content

Stochastic mortality modelling — Python port of the StMoMo R library

Project description

pyStMoMo

Stochastic Mortality Modelling in Python — a faithful Python port of the StMoMo R library by Villegas, Millossovich & Kaishev.

Overview

pyStMoMo implements a framework for fitting, forecasting, simulating and validating Generalised Age-Period-Cohort (GAPC) stochastic mortality models, including:

Model Reference
Lee-Carter (LC) Lee & Carter (1992)
Cairns-Blake-Dowd (CBD) Cairns et al. (2006)
Age-Period-Cohort (APC) Currie (2006)
Renshaw-Haberman (RH) Renshaw & Haberman (2006)
M6, M7, M8 Cairns et al. (2009)
Custom GAPC

Quick Start

import pystmomo as ps

data = ps.load_ew_male()
fit  = ps.lc().fit(data.deaths, data.exposures, ages=data.ages, years=data.years)
fc   = ps.forecast(fit, h=50)
sim  = ps.simulate(fit, nsim=5000, h=50, seed=42)

ps.plot_parameters(fit)
ps.plot_fan(sim, age=65)

Installation

pip install pystmomo

From source

git clone https://github.com/filipeclduarte/pyStMoMo
cd pyStMoMo
pip install -e ".[dev]"

Documentation

Full documentation at https://filipeclduarte.github.io/pyStMoMo.

References

  • Villegas, A.M., Millossovich, P., & Kaishev, V.K. (2018). StMoMo: An R Package for Stochastic Mortality Modelling. Journal of Statistical Software, 84(3).
  • Lee, R.D., & Carter, L.R. (1992). Modeling and Forecasting U.S. Mortality. JASA, 87(419), 659–671.
  • Cairns, A.J.G., Blake, D., Dowd, K., Coughlan, G.D., Epstein, D., Ong, A., & Balevich, I. (2009). A Quantitative Comparison of Stochastic Mortality Models Using Data From England and Wales and the United States. NAAJ, 13(1), 1–35.

License

GPL-2.0-or-later — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pystmomo-0.1.1.tar.gz (88.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystmomo-0.1.1-py3-none-any.whl (91.0 kB view details)

Uploaded Python 3

File details

Details for the file pystmomo-0.1.1.tar.gz.

File metadata

  • Download URL: pystmomo-0.1.1.tar.gz
  • Upload date:
  • Size: 88.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pystmomo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 28a47226dd176ef0560981ab7fb8b1a695ffd080e0bab3a2c754ea356acdfe89
MD5 6c433418aa35cec8445ad9c7f7efe981
BLAKE2b-256 f00548cdb44da90fcd06836962bc9307ba3c5ade7a691898d6a81a63080efc76

See more details on using hashes here.

File details

Details for the file pystmomo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pystmomo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 91.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pystmomo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf75d38eda694c921bca3480fe72a952c45f03fd12c217b6c108d5e95a09718c
MD5 8a9f5983d431b00a376a4ce76959935a
BLAKE2b-256 da210a3bc3e198cbf1c68fe0b3f99b6b48e4a62c49b6e444e6e8d1e1f932e09d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page