Chainladder

Property & casualty insurance loss reserving in Python. Chain ladder, Bornhuetter-Ferguson, Cape Cod, bootstrap simulation, and loss development pattern estimation. Actuarial triangle operations.

mkurman Updated 327 repo stars
Picture from the README

File contents

Overview

ChainLadder implements actuarial reserve estimation methods for property & casualty insurance. Use it for loss reserving, claims triangles, and actuarial modeling in Python.

Installation

uv pip install chainladder

Basic Triangle and Reserve

import chainladder as cl

# Load sample auto liability triangle
tri = cl.load_dataset("RAA")
print(tri)

# Select development pattern
dev = cl.Development().fit_transform(tri)

# Run chain ladder method
model = cl.ChainLadder().fit(dev)
print(model.reserve_)
print(model.ldf_)  # age-to-age factors

Mack Bootstrap

# Estimate reserve variability
mack = cl.MackChainLadder().fit(dev)
print(mack.reserve_)
print(f"CV: {mack.reserve_.std() / mack.reserve_.sum():.2%}")
print(mack.conditional_standard_error_)

Bornhuetter-Ferguson

bf = cl.BornhuetterFerguson().fit(dev)
print(bf.reserve_)
print(bf.expected_loss_)  # a priori expected loss

References

mkurman/zorai commit 712a6bf64f

Frequently asked questions

npx get-skill add mkurman/chainladder