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.0.tar.gz (59.5 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.0-py3-none-any.whl (34.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for experiencestudies-0.5.0.tar.gz
Algorithm Hash digest
SHA256 b1b38360789c6fd8659610f2b19228df4d4abb4b7de4af4170fe2af25a93c4f1
MD5 e7485a7c9366bcee274de84df9bef080
BLAKE2b-256 9e8f9a2f9df1e2d312fafb13f4ec1e894402359da032e83793ce80d8295ffc87

See more details on using hashes here.

Provenance

The following attestation bundles were made for experiencestudies-0.5.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for experiencestudies-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50462d4dc8bcbedf71d80e664a013ad7946520ec2f149723f1d9e52a6969a30e
MD5 fa39bd8c5c58f7664952c90ea5f27f87
BLAKE2b-256 be6d9eb4d555625e1fb7949e0d1b6df4106c39755ea5fa7e111c006954cc66ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for experiencestudies-0.5.0-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