Software
The projects here are intended to make actuarial work more explicit, testable, reproducible, and portable. They are open source and available on GitHub.
ratingtables
Table-driven insurance rating in R
ratingtables is a lightweight R package for executing insurance rating plans from policy or entity data, normalized factor tables, and an ordered calculation specification.
Rather than embedding an entire rating plan in product-specific code, the package separates the rating data, rate tables, and order of operations. This makes the mechanics of a plan easier to inspect, version, test, and audit.
What it supports
- normalized long-form rating-factor tables;
- ordered additive and multiplicative rating steps;
- coverage-specific rating specifications;
- entity-level rating and aggregation;
- driver or other sub-entity assignment and averaging;
- interactions and custom calculation stages;
- rate-set selection using explicit keys or descriptive filters;
- validation of rating plans, factor tables, and policy data;
- optional step-by-step trace output for audit and implementation review;
- efficient batch rating when trace output is not required.
ratingtables is available on CRAN.
install.packages("ratingtables")GitHub repository CRAN Video demo
actuarialfitdist
Actuarial severity distribution fitting with limits and deductibles
actuarialfitdist is an R package for fitting claim severity distributions and translating those fits into insurance rating factors.
Unlike general-purpose distribution fitting tools, the package explicitly accounts for deductible truncation, policy-limit censoring, and severity scaling in the fitting process. This allows analysts to estimate ground-up claim severity distributions from insurance loss data observed under different policy terms.
The package connects statistical severity modeling with practical ratemaking applications, including the calculation of increased limits factors, deductible factors, and other loss-cost adjustments.
What it supports
- maximum-likelihood fitting with deductible truncation and policy-limit censoring;
- common actuarial severity distributions, including lognormal, Weibull, gamma, Burr, Pareto II, and generalized Pareto;
- severity scaling using coverage amounts, insured values, or other numerical variables;
- observation weights and fixed distribution parameters;
- comparison of candidate distributions using likelihood, information criteria, and diagnostic plots;
- spliced body-tail distributions with fixed or optimized thresholds;
- limited expected values and loss elimination ratios;
- increased limits factors, deductible factors, and combined rating factors;
- valuation and depreciation adjustments;
- goodness-of-fit diagnostics, simulation, and uncertainty estimation;
- customizable visualizations and access to underlying plotting data.
Typical workflow
- Start with ground-up claim severity data, including applicable deductibles and limits.
- Fit one or more candidate severity distributions.
- Compare fitted models using statistical diagnostics and their implications for rating factors.
- Calculate limited expected values, increased limits factors, or deductible factors.
- Evaluate the sensitivity of the resulting factors to distribution choice and model assumptions.
The package is designed to support both statistical model evaluation and the practical application of severity models in insurance pricing.
actuarialfitdist is available on CRAN.
install.packages("actuarialfitdist")raterevision
Reproducible workflows for revising insurance rate tables
raterevision is an R package built around the idea that a rate revision should preserve a clear chain from current rates to proposed rates.
It provides tools for working with rate tables outside the rating engine itself: exporting tables for review or editing, importing them back into R, applying programmatic changes, and evaluating the effect of those changes using ratingtables.
A revision can therefore be expressed as a readable sequence of changes rather than only as a final collection of replacement tables.
Typical workflow
- Start with the current rating tables.
- Export selected tables to Excel when manual review or editing is useful.
- Apply rate changes either programmatically or through an import workflow.
- Use
ratingtablesto rate current and proposed plans. - Measure overall and segment-level effects.
- Preserve the code and resulting tables as a reproducible record of the revision.
raterevision is currently available from GitHub and is not yet on CRAN.
install.packages("pak")
pak::pkg_install("gs-actuary/raterevision")The Armchair Actuary YouTube channel includes three demonstrations of raterevision.
GitHub repository Watch the demos
aglmtools
Development-stage tools for interpretable regularized GLMs
aglmtools is an R project exploring actuarial applications of regularized generalized linear models with interpretable feature transformations.
The project includes cumulative ordered encodings inspired by Accurate GLM approaches, elastic-net estimation, and tools for handling common actuarial predictor structures such as ordered numeric variables and categorical effects.
This project is less mature than ratingtables, actuarialfitdist, and raterevision; the GitHub repository is the best place to follow its current development.
Demonstrations and discussion
The Armchair Actuary YouTube channel contains demonstrations of the rating and rate-revision tools.
If you are experimenting with one of these packages—or working through a rating, severity, or modeling problem that exposes a limitation in them—I welcome feedback and discussion.