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.
Metadata
Release files for pystmomo 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pystmomo-0.1.1.tar.gz | 88.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pystmomo-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 179.2 kB
Release files / pystmomo-0.1.1.tar.gz
| Download URL | pystmomo-0.1.1.tar.gz |
|---|---|
| Size | 88.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28a47226dd176ef0560981ab7fb8b1a695ffd080e0bab3a2c754ea356acdfe89
|
|
BLAKE2b-256 checksum How to use checksums |
f00548cdb44da90fcd06836962bc9307ba3c5ade7a691898d6a81a63080efc76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / pystmomo-0.1.1-py3-none-any.whl
| Download URL | pystmomo-0.1.1-py3-none-any.whl |
|---|---|
| Size | 91.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf75d38eda694c921bca3480fe72a952c45f03fd12c217b6c108d5e95a09718c
|
|
BLAKE2b-256 checksum How to use checksums |
da210a3bc3e198cbf1c68fe0b3f99b6b48e4a62c49b6e444e6e8d1e1f932e09d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|