Model total annual losses as a random number of claims with random sizes, by formula and by simulation.
Why it matters
A property and casualty insurer does not ask "will this person die?" but "how many claims will this portfolio have, and how big will they be?" The total paid in a year, the aggregate loss, drives premiums, reinsurance purchases and how much capital the company must hold. Actuaries build it from two simpler pieces, frequency (how many claims) and severity (how large each claim is). This collective risk model is the backbone of short-term actuarial mathematics on the SOA and CAS exams.
The collective risk model
S = X_1 + X_2 + ... + X_N
Nis the number of claims in the period (frequency). Common choices: Poisson, negative binomial (more spread than Poisson), binomial (fewer).X_1, X_2, ...are the claim sizes (severity), independent of each other and ofN, with the same distribution. Common choices: exponential, gamma, lognormal, Pareto (for heavy tails).- If
N = 0, thenS = 0.
The two key formulas
E[S] = E[N] * E[X]
Var[S] = E[N] * Var[X] + Var[N] * E[X]^2
The variance has two parts: uncertainty in claim sizes, and uncertainty in how many claims there are. When N is Poisson with mean lambda, E[N] = Var[N] = lambda and the formula simplifies to Var[S] = lambda * E[X^2].
Worked example 1: Poisson and exponential
A small book of policies has Poisson claim counts with mean 2 per year, and exponential claim sizes with mean 5,000 (so Var[X] = 5000^2 and E[X^2] = 2 * 5000^2 = 50,000,000).
E[S] = 2 * 5,000 = 10,000
Var[S] = 2 * 50,000,000 = 100,000,000
SD[S] = 10,000
P(S = 0) = P(N = 0) = e^(-2) = 0.1353
The standard deviation equals the mean: one bad year can easily cost double the average. That is why small books need reinsurance or more capital.
Worked example 2: a more variable frequency
Suppose instead E[N] = 3, Var[N] = 6 (a negative binomial), E[X] = 2,000 and Var[X] = 1,000,000:
E[S] = 3 * 2,000 = 6,000
Var[S] = 3 * 1,000,000 + 6 * 2,000^2 = 3,000,000 + 24,000,000 = 27,000,000
SD[S] = 5,196
Here most of the variance comes from frequency, a common pattern when claims are driven by shared events such as storms.
Simulation
Formulas give the mean and variance, but pricing a reinsurance layer or a capital requirement needs the whole distribution, such as the 99.5th percentile. Monte Carlo simulation is the practical tool: simulate many years, and in each year draw a claim count and then that many claim sizes.
import random
rng = random.Random(42) # fixed seed: same results every run
claims = 3
year_total = sum(rng.expovariate(1 / 5000) for _ in range(claims))
Python's standard library has no Poisson sampler, but a short helper (Knuth's method, provided in the activity) works for small means. In larger work you would use numpy.random.default_rng(seed).poisson(lam, size) and vectorise the whole simulation, or exact methods such as Panjer's recursion. With 20,000 simulated years, the sample mean and variance should land within a few percent of the formulas; if they do not, the code has a bug.
Policy features change the model
A deductible of d removes small claims and reduces every other claim by d, which changes both frequency (fewer claims reach the insurer) and severity. A policy limit caps severity. Inflation raises severity over time. Actuaries apply these adjustments before fitting or simulating.
Common mistakes
- Forgetting the frequency term in the variance.
Var[S]is notE[N] * Var[X]alone. - Assuming independence that is not there. A hurricane creates many claims at once; claims are not independent then.
- Unseeded simulations. Without a fixed seed, results change every run and cannot be reviewed or reproduced.
- Too few simulations for tail percentiles. The 99.5th percentile needs far more runs than the mean.
Quick recap
- Aggregate loss
S= sum of a random numberNof random claimsX. E[S] = E[N]E[X];Var[S] = E[N]Var[X] + Var[N]E[X]^2; Poisson:Var[S] = lambda E[X^2].- Simulate with a fixed seed to get the full distribution and check it against the formulas.
Try it
In the Do tab, code the formulas and a seeded simulation, and check that they agree.