Open-source actuarial tooling for Python — a small, composable ecosystem for experience analysis, projection, pricing, loss modeling, and capital, built on a shared primitives library.
📚 Documentation: openactuarial.org · License: MIT
| Package | What it does | Install |
|---|---|---|
| actuarialpy | The shared primitives — ratios and per-exposure metrics, chain-ladder development and IBNR, credibility, trend, seasonality, financial mathematics (time value of money), exposure and lifecycle bases, banding, pooling, margins, and weighted rollups. Pure calculation on numpy and pandas; the three workflow layers below build on it. | pip install actuarialpy |
| experiencestudies | Experience reporting and analysis — experience summaries and views, actual-versus-expected, claimant and concentration analysis, cohort and duration studies, driver and frequency–severity decomposition, rolling monitors, the two-tier underwriting summary, and the fluent Experience object. Builds on actuarialpy. |
pip install experiencestudies |
| projectionmodels | Focused claim, premium, and expense projections on supplied exposure — renewal rate actions, a complete → deseasonalize → trend → blend → reseasonalize claim pipeline, scenario adjustments, and summaries that never average ratios or duplicate exposure. Builds on actuarialpy. |
pip install projectionmodels |
| ratingmodels | Group rate build-up and indication — manual and experience rating, an auditable build-up engine, GLM relativities, retention gross-up, and renewal. Builds on actuarialpy. |
pip install ratingmodels |
| lossmodels | Loss-distribution modeling — severity and frequency fitting, and aggregate loss. | pip install lossmodels |
| extremeloss | Extreme-value tail estimation — peaks-over-threshold / GPD and large-claim loading. | pip install extremeloss |
| risksim | Portfolio Monte Carlo simulation and risk measures. | pip install risksim |
The top row is one analysis, left to right — experience, projection, pricing,
loss, tail, and capital. actuarialpy is not a stage of that analysis: it is
the primitives library the first three stages build on.
flowchart LR
AP["actuarialpy<br/>shared primitives"]:::core
ES["experiencestudies<br/>experience"]
PM["projectionmodels<br/>projection"]
RM["ratingmodels<br/>pricing"]
LM["lossmodels<br/>loss"]
EL["extremeloss<br/>tail"]
RS["risksim<br/>capital"]
ES --> PM --> RM --> LM --> EL --> RS
AP --> ES
AP --> PM
AP --> RM
classDef core fill:#eaf2ff,stroke:#3a6ea5,stroke-width:2px,color:#1a1a1a
The workflow arrows are the analytical sequence, not install requirements.
Credibility, trend, completion, seasonality, financial math, and exposure live
once, in actuarialpy; experiencestudies, projectionmodels, and
ratingmodels delegate to it rather than re-implementing. lossmodels,
extremeloss, and risksim install independently (extremeloss can
optionally integrate lossmodels for severity splicing). Dependencies stay
light throughout: numpy and pandas, with scipy where the loss and tail work
needs it and statsmodels for the GLMs in ratingmodels.
The layers compose directly — the study layer reads the block, the primitives supply credibility, and the pricing layer blends and indicates:
import pandas as pd
import actuarialpy as ap
import experiencestudies as es
import ratingmodels as rm
df = pd.DataFrame({
"month": pd.date_range("2025-01-01", periods=12, freq="MS"),
"segment": ["ppo"] * 12,
"allowed": [8_000 * v for v in [498, 505, 512, 508, 516, 511,
519, 514, 522, 517, 509, 513.0]],
"premium": [8_000 * 560.0] * 12,
"member_months": [8_000] * 12,
})
# study layer: how is the block performing?
exp = es.Experience(df, expense="allowed", revenue="premium",
exposure="member_months", date="month")
seg = exp.by("segment") # loss ratio 0.914
loss_cost = seg["total_expense_per_member_months"].iloc[0] # 512.00 per member-month
# primitives: credibility for the block's own experience
z = ap.limited_fluctuation_z(exposure=96_000, full_credibility_standard=120_000) # 0.894
# pricing: blend against a manual rate and indicate
manual = rm.ManualRate(base_loss_cost=480, factors={"area": 1.05, "industry": 0.97})
indication = rm.RateIndication(
experience_loss_cost=loss_cost,
manual_loss_cost=manual.loss_cost(),
credibility=z,
current_rate=560,
target_loss_ratio=0.85,
)
indication.indicated_rate_change() # +7.0% — the indicated rate change
indication.rate_change_decomposition() # an auditable explanation of why it movedInstall any package with pip (above), or the whole ecosystem:
pip install actuarialpy experiencestudies projectionmodels ratingmodels lossmodels extremeloss risksimEach has its own guide and full API reference at openactuarial.org.
All packages are released under the MIT License.