| layout |
default |
| title |
The Stack |
| permalink |
/stack/ |
<style>
.stack-stage {
margin: 2rem 0;
}
.stage-label {
font-size: 0.75rem;
font-weight: 700;
letter-spacing: 0.08em;
text-transform: uppercase;
color: #6b7280;
margin-bottom: 0.25rem;
}
.lib-row {
margin: 0.5rem 0;
}
.lib-row a {
font-weight: 600;
}
.workflow-line {
font-size: 1rem;
font-weight: 600;
margin: 0.75rem 0;
color: #374151;
}
.arrow {
color: #9ca3af;
margin: 0 0.4rem;
}
</style>
Ten libraries. One workflow. Here is what to reach for at each stage.
Data prep
→
Smoothing
→
Modelling
→
Validation
→
Deployment
→
Monitoring
insurance-datasets — Synthetic UK motor data with a known data-generating process. Use it to validate your pipeline before touching production data, or to benchmark a new method against something with ground truth.
insurance-whittaker — Whittaker-Henderson penalised smoothing with automatic REML lambda selection and Bayesian credible intervals. Replaces the Excel five-point moving average for experience rating curves.
insurance-gam — Interpretable tariff models: Explainable Boosting Machines, Actuarial NAM, and PIN. Shape functions a pricing actuary can read; exact Shapley values for relativities.
insurance-causal — Double Machine Learning for causal inference. Estimates price elasticity, renewal CATEs, and telematics treatment effects from observational data, with valid frequentist confidence intervals.
insurance-credibility — Bühlmann-Straub group credibility and Bayesian individual experience rating. Finds the optimal blend between a scheme's own history and the portfolio average.
insurance-frequency-severity — Sarmanov bivariate model for correlated frequency and severity. Fits on top of your existing statsmodels GLMs; returns per-policy correction factors.
insurance-telematics — HMM-based trip scoring into latent driving regimes, credibility-weighted to driver level, producing GLM-ready features you can explain to the FCA.
insurance-conformal — Distribution-free prediction intervals for Tweedie and Poisson models. Finite-sample coverage guarantee, 13–14% narrower than parametric baselines on heterogeneous motor books.
insurance-fairness — Proxy discrimination audit for FCA Consumer Duty. Detects which rating factors act as protected-characteristic proxies; generates a sign-off-ready Markdown report with regulatory cross-references.
insurance-optimise — Constrained portfolio rate optimisation. Enforces FCA PS21/5 ENBP ceilings, loss ratio targets, retention floors, and rate-change caps simultaneously; produces an auditable JSON pricing record.
insurance-monitoring — Model drift detection across three axes: covariate shift (PSI/CSI per feature), calibration drift (A/E with Murphy decomposition), and discrimination decay (Gini drift z-test). Returns a structured RECALIBRATE / REFIT / NO_ACTION recommendation.
Motor pricing refresh
insurance-datasets → insurance-whittaker → insurance-gam → insurance-conformal → insurance-fairness → insurance-optimise → insurance-monitoring
Start with synthetic data to validate the pipeline, smooth experience curves, fit an interpretable tariff, attach distribution-free prediction intervals, audit for proxy discrimination, optimise rates under FCA constraints, then monitor post-deployment.
Renewal pricing with causal elasticity
insurance-causal → insurance-optimise → insurance-fairness → insurance-monitoring
Estimate causal price sensitivity from your existing renewal book (correcting the confounding that a raw GLM carries), feed CATE-segmented elasticities into the constrained optimiser, audit the resulting differentials for Consumer Duty compliance, and track the deployed rates.
Telematics product build
insurance-telematics → insurance-causal → insurance-gam → insurance-conformal
Score raw trip data through an HMM into auditable driver-level features, use DML to estimate the causal effect of driving style on claims (separating it from correlated demographics), fit an interpretable tariff with shape functions, and quantify per-policy uncertainty before deployment.
Scheme and fleet pricing
insurance-credibility → insurance-frequency-severity → insurance-optimise
Blend thin scheme experience with portfolio rates using Bühlmann-Straub credibility, apply a Sarmanov correction for frequency-severity dependence driven by NCD structure, then optimise the scheme terms under commercial and regulatory constraints.