Metadata-Version: 2.5
Name: catmodeling
Version: 0.0.1
Summary: Catastrophe risk modeling: simulate and adjust event/year loss tables, price catXL reinsurance layers, and apply hours clauses.
Project-URL: Homepage, https://www.catmodeling.info
Project-URL: Repository, https://github.com/prthota98/catmodeling
Project-URL: Original R package, https://github.com/stephenjewson/catmodeling
Author: Stephen Jewson and Prasad Thota
Maintainer-email: Prasad Thota <prthota98@gmail.com>
License-Expression: AGPL-3.0-or-later
License-File: LICENSE
Keywords: actuarial,catastrophe modeling,climate risk,event loss table,insurance,reinsurance,risk modeling,year loss table
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Intended Audience :: Science/Research
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 :: Office/Business :: Financial
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Requires-Python: >=3.10
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scipy
Requires-Dist: shapely
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Description-Content-Type: text/markdown

# catmodeling

Manipulation of catastrophe model outputs, including simulating year loss tables (YLTs) from event loss tables (ELTs), adjusting the frequencies of events in YLTs to create new YLTs, applying catastrophe excess of loss contracts (catXL), applying hours clauses, and calculating diagnostics such as average annual loss and exceedance probability curves.

Frequency adjustment routines are based on Jewson, S. (2023), "A new simulation algorithm for more precise estimates of change in catastrophe risk models, with application to hurricanes and climate change" (doi:10.1007/s00477-023-02409-0).

## Installation

```bash
pip install catmodeling
```

## Usage

```python
import numpy as np
import pandas as pd
from catmodeling.simulate import yltsim

# an event loss table (ELT): one row per possible event
elt = pd.DataFrame({
    "evid": [1, 2, 3],
    "mrate": [0.1, 0.05, 0.02],       # annual occurrence rate
    "mloss": [1_000_000, 5_000_000, 20_000_000],  # mean loss
})

# simulate a 1,000-year year loss table (YLT) from it
longylt = yltsim(nyearsinylt=1000, elt=elt, rng=np.random.default_rng(0))
print(longylt.head())
```

More examples covering the full pipeline (frequency adjustment, catXL layer pricing, hours clauses, and diagnostics) are in the `examples/` directory.

## Attribution

The original methodology and R implementation (`catmodeling`, available on [CRAN](https://cran.r-project.org/package=catmodeling) and [GitHub](https://github.com/stephenjewson/catmodeling)) are by Stephen Jewson. This package is a Python implementation of that methodology, developed by Prasad Thota.

## License

AGPL-3.0-or-later, consistent with the original R package.