Metadata-Version: 2.4
Name: pystmomo
Version: 0.1.1
Summary: Stochastic mortality modelling — Python port of the StMoMo R library
Project-URL: Homepage, https://github.com/filipeclduarte/pyStMoMo
Project-URL: Documentation, https://filipeclduarte.github.io/pyStMoMo
Project-URL: Repository, https://github.com/filipeclduarte/pyStMoMo
Project-URL: Issues, https://github.com/filipeclduarte/pyStMoMo/issues
Author-email: Filipe Duarte <duartfilipe@gmail.com>
License: GPL-2.0-or-later
License-File: LICENSE
Keywords: CBD,Lee-Carter,actuarial,demography,mortality,stochastic
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Requires-Dist: matplotlib<4,>=3.8
Requires-Dist: numpy<3,>=1.26
Requires-Dist: pandas<3,>=2.1
Requires-Dist: scipy<2,>=1.11
Requires-Dist: statsmodels<1,>=0.14
Provides-Extra: all
Requires-Dist: hypothesis; extra == 'all'
Requires-Dist: joblib>=1.3; extra == 'all'
Requires-Dist: mkdocs-jupyter>=0.24; extra == 'all'
Requires-Dist: mkdocs-material>=9.5; extra == 'all'
Requires-Dist: mkdocs>=1.6; extra == 'all'
Requires-Dist: mkdocstrings[python]>=0.25; extra == 'all'
Requires-Dist: mypy>=1.10; extra == 'all'
Requires-Dist: nbmake; extra == 'all'
Requires-Dist: pre-commit; extra == 'all'
Requires-Dist: pytest-cov; extra == 'all'
Requires-Dist: pytest>=8; extra == 'all'
Requires-Dist: ruff>=0.5; extra == 'all'
Provides-Extra: dev
Requires-Dist: hypothesis; extra == 'dev'
Requires-Dist: joblib>=1.3; extra == 'dev'
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: nbmake; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: pytest-cov; extra == 'dev'
Requires-Dist: pytest>=8; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Provides-Extra: docs
Requires-Dist: mkdocs-jupyter>=0.24; extra == 'docs'
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
Requires-Dist: mkdocs>=1.6; extra == 'docs'
Requires-Dist: mkdocstrings[python]>=0.25; extra == 'docs'
Provides-Extra: parallel
Requires-Dist: joblib>=1.3; extra == 'parallel'
Description-Content-Type: text/markdown

# pyStMoMo

**Stochastic Mortality Modelling in Python** — a faithful Python port of the
[StMoMo](https://github.com/amvillegas/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

```python
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

```bash
pip install pystmomo
```

### From source

```bash
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](LICENSE).
