Skip to main content

Experience reporting and analysis on tidy tables: experience summaries and views, actual-versus-expected, claimant and cohort studies, driver and frequency-severity decomposition, rolling monitors, banded summaries. Study functions over the canonical actuarialpy.Experience.

Project description

experiencestudies

Experience reporting and monitoring workflows on tidy data.

CI PyPI Python

Overview

experiencestudies turns tidy period-by-cell tables into the reports an experience team actually ships: experience summaries, actual-versus-expected against a plan, claimant and concentration analysis, cohort and duration studies, driver decomposition, rolling monitors, and a one-call Excel packet.

Every workflow is available both as a free function on a DataFrame and over the canonical actuarialpy.Experience, which carries column roles (revenue, expense, exposure, date) so views compose without repeating configuration.

Installation

pip install experiencestudies

Requires Python 3.10 or newer.

Quick start

import pandas as pd
import experiencestudies as es

df = pd.DataFrame({
    "month": pd.date_range("2024-01-01", periods=12, freq="MS"),
    "lob": ["med"] * 12,
    "claims": [820, 910, 875, 1010, 990, 1105, 1080, 1240, 1180, 1035, 995, 1150.0],
    "premium": [1500.0] * 12,
    "member_months": [1000.0] * 12,
})

# free-function form
summary = es.summarize_experience(
    df, groupby="lob",
    expense_cols="claims", revenue_cols="premium", exposure_cols="member_months",
)
print(summary)

# Experience form — same result, plus composable views
from actuarialpy import Experience

exp = Experience(df, expense="claims", revenue="premium",
                 exposure="member_months", date="month")
print(es.summary(exp, "lob"))
print(es.rolling(exp, 3).tail(3))

What's inside

  • Experience summaries — grouped ratios, per-exposure rates, and rollups via summarize_experience or study functions over the Experience.
  • Actual versus expected — plan merge, A/E summaries, and forecast comparison.
  • Claimant analysis — top claimants, large-claimant flags, and claim_concentration threshold statements.
  • Cohorts and durations — cohort assembly and duration-based studies.
  • Decomposition — frequency/severity/mix drivers that reconcile exactly to the total change.
  • Rolling monitors — trailing windows for emerging-experience review.
  • Reportingunderwriting_summary and to_excel_report for a multi-sheet packet.

The full API reference and end-to-end worked examples live at openactuarial.org/experiencestudies.html.

The OpenActuarial ecosystem

experiencestudies is one of seven packages that share conventions — tidy tables, explicit distribution parameterizations, reproducible random-number handling — and compose across package seams:

Package Role
actuarialpy Calculation primitives the workflow packages build on
experiencestudies Experience reporting, actual-vs-expected, claimant and concentration analysis
projectionmodels Claim, premium, and expense projection over a renewal horizon
ratingmodels Manual and experience rating, credibility, indication, GLM relativities
lossmodels Severity and frequency fitting, aggregate loss distributions
extremeloss Extreme-value tails: POT/GPD, GEV, return levels, splicing
risksim Portfolio Monte Carlo, dependence, reinsurance contracts, risk measures

Install everything at once with pip install openactuarial.

Development

git clone https://github.com/OpenActuarial/experiencestudies
cd experiencestudies
python -m pip install -e ".[dev]"
pytest
ruff check src tests

CI runs the same gate on Python 3.10–3.14 across Linux and Windows.

Versioning and stability

All ecosystem packages are pre-1.0: minor releases may change APIs, and every release is documented in CHANGELOG.md. Current per-package API stability is tracked at openactuarial.org/stability.html.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

experiencestudies-0.5.1.tar.gz (60.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

experiencestudies-0.5.1-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

Details for the file experiencestudies-0.5.1.tar.gz.

File metadata

  • Download URL: experiencestudies-0.5.1.tar.gz
  • Upload date:
  • Size: 60.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for experiencestudies-0.5.1.tar.gz
Algorithm Hash digest
SHA256 d830933cdb63267f1c61720a97e43c3a2c4999b94705d5e21b44bcff9770e0c1
MD5 62e0c0b5751ca096aabc7ef453a9a298
BLAKE2b-256 d0c45cfaaa84f3d4e56c0360c9641077723cd4565a524b74b60ccac835a41d18

See more details on using hashes here.

Provenance

The following attestation bundles were made for experiencestudies-0.5.1.tar.gz:

Publisher: release.yml on OpenActuarial/experiencestudies

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file experiencestudies-0.5.1-py3-none-any.whl.

File metadata

File hashes

Hashes for experiencestudies-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e5e844256846466763b5a7dca6cbc644001ef92ec8782b382402cb5e87647ccc
MD5 0991b03ddfa645af6c2ee739c11ff844
BLAKE2b-256 99b48bee0936868259156338187fcff4407576bc303a75b7096b66b2717c23cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for experiencestudies-0.5.1-py3-none-any.whl:

Publisher: release.yml on OpenActuarial/experiencestudies

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page