OpenActuarial¶
OpenActuarial is a dependency-light Python ecosystem for general actuarial workflows, including experience analysis, rating and pricing models, loss modeling, tail estimation, simulation, and portfolio capital. The packages are modular and can be installed individually, with actuarialpy providing shared foundational components for packages that require them.
The ecosystem¶
The core. Experience analysis on a tidy table, plus the shared
primitives — credibility, trend, completion, seasonality, financial
mathematics, exposure, and underwriting margin — that ratingmodels
builds on directly.
Pricing. Manual and experience rate build-up, credibility blending, rate indication and decomposition, GLM relativities with diagnostics, frequency–severity models, validation splits and tables, renewal constraints, dislocation reporting, and pricing scenarios with margin targets.
Loss modeling. Severity and frequency fitting — including under deductibles and limits — and aggregate loss distributions.
Tails. Extreme-value tail estimation — peaks-over-threshold / GPD and large-claim loading.
Capital. Portfolio Monte Carlo simulation and risk measures.
The workflow¶
Left to right, the packages trace one analysis — experience, pricing, loss, tail, and capital:
flowchart LR
AP["actuarialpy<br/>experience"]:::core
RM["ratingmodels<br/>pricing"]
LM["lossmodels<br/>loss"]
EL["extremeloss<br/>tail"]
RS["risksim<br/>capital"]
AP --> RM --> LM --> EL --> RS
classDef core fill:#eaf2ff,stroke:#3a6ea5,stroke-width:2px,color:#1a1a1a
The arrows are the analytical sequence, not install requirements. actuarialpy
is the shared core — credibility, trend, financial math, and exposure live there
once — and ratingmodels builds directly on it. lossmodels, extremeloss, and
risksim install independently (extremeloss can optionally integrate
lossmodels for severity splicing).
The full arc is runnable end to end — see the worked examples: Example 1: experience to a renewal rate, Example 2: pricing a book, in columns, Example 3: claims to capital, Example 4: censored payments to coverage terms, Example 5: triangle to indicated change, and Example 6: pricing the tail, with error bars.
A cross-package example¶
Blend an experience rate with a manual rate and read the indicated change:
import actuarialpy as ap
import ratingmodels as rm
# credibility from exposure (lives in actuarialpy; ratingmodels delegates to it)
z = ap.limited_fluctuation_z(exposure=96_000, full_credibility_standard=120_000)
manual = rm.ManualRate(base_loss_cost=480, factors={"area": 1.05, "industry": 0.97})
indication = rm.RateIndication(
experience_loss_cost=512,
manual_loss_cost=manual.loss_cost(),
credibility=z,
current_rate=560,
target_loss_ratio=0.85,
)
indication.indicated_rate_change() # blended, credibility-weighted change
indication.rate_change_decomposition() # attribute the change to each driver
Every numeric argument above also accepts a column — the same call prices a whole book; see Example 2: pricing a book, in columns.
Install¶
pip install actuarialpy ratingmodels lossmodels extremeloss risksim
Each package installs independently; ratingmodels pulls in actuarialpy and
statsmodels as dependencies.