Chainladder

From mkurman/zorai · View interactive version

Chainladder is an AI agent skill from the GitHub repository mkurman/zorai. Property & casualty insurance loss reserving in Python. Chain ladder, Bornhuetter-Ferguson, Cape Cod, bootstrap simulation, and loss development pattern estimation. Actuarial triangle operations.

How to use this skill

Skill file

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.