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, and the fluent Experience object. Built on actuarialpy.

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 through the fluent Experience object, 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)

# fluent form — same result, plus composable views
exp = es.Experience(df, expense="claims", revenue="premium",
                    exposure="member_months", date="month")
print(exp.by("lob"))
print(exp.rolling(3).tail(3))

What's inside

  • Experience summaries — grouped ratios, per-exposure rates, and rollups via summarize_experience or the fluent Experience object.
  • 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.3.1.tar.gz (61.3 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.3.1-py3-none-any.whl (36.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for experiencestudies-0.3.1.tar.gz
Algorithm Hash digest
SHA256 903ca292e6cc7f3c3dbac745f36f8b4db01de72634ec5ef607e50113b6dfc44c
MD5 c70d014bc7e289bad27574f8f44b76ea
BLAKE2b-256 8835c577f8da896d4c32955d7fb27a6eb26bd0de3914be1f392adef2a4d37117

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for experiencestudies-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dd7a70e5515642234cfc5c783d133481bc96146025640b45f1abe44fda9c2e38
MD5 00ec796ec329ae7331734cfead233882
BLAKE2b-256 82d0a43310d76a7feba511a9c06838ee3d3577a74a7d0aa004503f1b72416fa5

See more details on using hashes here.

Provenance

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