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/filipeduarte/pyStMoMo
cd pyStMoMo
pip install -e ".[dev]"
Documentation
Full documentation at https://filipeduarte.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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pystmomo-0.1.0.tar.gz.
File metadata
- Download URL: pystmomo-0.1.0.tar.gz
- Upload date:
- Size: 79.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53103abb4693cc88564610e161affffdd06f1b98ac686fedc9a7d93e75713482
|
|
| MD5 |
553d2b20a500cbac7982acad15300f6e
|
|
| BLAKE2b-256 |
b66d3caf0a05de3c01dffcd444d06685c21c51327c4fe2b214f0fefd431149c8
|
File details
Details for the file pystmomo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pystmomo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 87.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9006d9d567a3df9765685e1100de6dd1f48a6c1f90f1777cc5c47908c6b8b5f8
|
|
| MD5 |
609c6ff2e359702ee0c9f636ed2601a0
|
|
| BLAKE2b-256 |
d6c7156ca0157b671e6261fe790fc8298b591f3db508b4a37865a8ffb4e9ba66
|