Skip to content
View OpenActuarial's full-sized avatar

Block or report OpenActuarial

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
openactuarial/README.md

OpenActuarial

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


The ecosystem

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

How they compose

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
Loading

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.

A workflow across the ecosystem

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 moved

Getting started

Install any package with pip (above), or the whole ecosystem:

pip install actuarialpy experiencestudies projectionmodels ratingmodels lossmodels extremeloss risksim

Each has its own guide and full API reference at openactuarial.org.

License

All packages are released under the MIT License.

Popular repositories Loading

  1. lossmodels lossmodels Public

    Actuarial loss modeling in Python: severity, frequency, aggregate loss, fitted distributions, and insurance loss analytics.

    Python 1

  2. risksim risksim Public

    Portfolio Monte Carlo risk simulation in Python for insurance risk, aggregate loss, capital modeling, and risk measures.

    Python

  3. extremeloss extremeloss Public

    Extreme-value tail-risk estimation in Python: peaks-over-threshold, GPD fitting, rare-event analysis, and large-claim loading.

    Python

  4. actuarialpy actuarialpy Public

    Core actuarial analysis tools for Python: per-exposure metrics, trend, completion, seasonality, credibility, exposure, and TVM.

    Python

  5. docs docs Public

    Documentation site for the OpenActuarial Python ecosystem: actuarialpy, ratingmodels, lossmodels, extremeloss, and risksim.

    Makefile

  6. openactuarial openactuarial Public

    Open-source actuarial tooling for Python: experience analysis, pricing/rating, loss modeling, risk simulation, and tail-risk methods.