Calibrating event frequency above a threshold

A recipe for calibrating the frequency and severity of loss events above a threshold, for perils such as severe convective storm (hail, tornado), when:

The output is the forecast-year count distribution above a contract threshold, plus the severity above it.

The model

Each year draws its own activity level, and events follow a Poisson process given that level:

Λi∼Gamma(r,β),ni∣Λi∼Poisson(Λi)⇒ni∼NB(r,β)

β is the Gamma scale. What is calibrated is the shared parameters (r, β): the mean rate rβ and its year-to-year variability. The fitted NegativeBinomial(r, β) is the forecast-year distribution, because next year is a fresh draw of Λ.

It is a plug-in estimate: uncertainty in (r, β) itself is not included. See Parameter uncertainty.

Method: one common on-levelled threshold

Why it works

On-level each raw loss to the forecast year's TIV:

yj=xj·TIVmodel/TIVi

Year i only recorded losses with x > u. In today's money, its record is therefore complete only above ui = u·TIVmodel/TIVi. That threshold differs by year, and is highest for the lowest-TIV year. Above

u*=u·maxiTIVmodelTIVi

every year's record is complete. Counts of on-levelled losses above u* are therefore directly comparable across years, with no volume adjustment. The on-levelled losses above u* are a clean sample for the severity.

Frequency and severity are fitted to the same events, on the same basis, above the same threshold.

Recipe

Input Meaning
u the fixed raw threshold the history was recorded at
years(i) the historical years, contiguous
tivIndex a CalendarYearLevels of TIV by year, whose current year is the forecast year at TIVmodel
rawLossesByYear(i) raw loss of every event in years(i) with loss > u; may be empty
d contract threshold, d ≥ u*

Holding TIV as a CalendarYearLevels makes the on-levelling inspectable. tivIndex.onLevelFactor(year) is TIVmodel/TIVi, tivIndex.suggestedNewThreshold(u, year) is ui, and tivIndex.plotLevels() plots the index, with each year's on-level factor in the tooltip. plotLevels needs import vecxt_re.all.* and a plot target in scope.

  1. Common threshold: u* = maxi ui = u · maxi(TIVmodel/TIVi), the largest of the per-year suggestedNewThresholds.
  2. On-level and filter: yj = tivIndex.onLevel(x, year) = xj·TIVmodel/TIVi, keeping only yj > u*.
  3. Severity: a Pareto tail above u*, using the maximum-likelihood estimate with known threshold:

    α^=m*∑jlog(yj/u*)

    Here m* is the number of on-levelled losses above u*.

  4. Frequency: fit NegativeBinomial.mle to the per-year counts above u*. It returns NB(r, β), or Poisson if the counts are not overdispersed.
  5. Forecast year above d: each event exceeds d with probability (u*/d)α̂, so thin the frequency and take the severity above d from the same tail:

    Nd∼NB(r,β·(u*/d)α^),X∣X>d∼Pareto(d,α^)

Losses are in today's money throughout.

Code

The inputs. rawLossesByYear would be your data. Here it is a seeded synthetic sample generated from the model itself, so the page is reproducible. Each year has NB(4, 4) events above u at today's TIV with Pareto(u, 1.4) losses, scaled back to that year's TIV, keeping what a raw record would hold.

import vecxt_re.*
import org.apache.commons.rng.simple.RandomSource
import org.apache.commons.statistics.distribution.{GammaDistribution, PoissonDistribution}

val u = 10.0e6
val years = (2016 to 2025).toArray
val tivIndex = CalendarYearLevels(
  years :+ 2026, // the forecast year is the index's current year
  Array(55.0, 58, 62, 66, 70, 75, 81, 86, 92, 100) :+ 105.0
)

val rng = RandomSource.XO_RO_SHI_RO_128_PP.create(java.lang.Long.valueOf(42L))
val activity = GammaDistribution.of(4.0, 4.0).createSampler(rng)
val rawLossesByYear: Array[Array[Double]] = years.map { y =>
  val n = PoissonDistribution.of(activity.sample()).createSampler(rng).sample()
  Array
    .fill(n)(u * math.pow(1.0 - rng.nextDouble(), -1.0 / 1.4)) // Pareto(u, 1.4) at today's TIV
    .map(_ / tivIndex.onLevelFactor(y)) // back to year y's TIV
    .filter(_ > u)
}

The recipe:

// 1. Common on-levelled threshold: the largest per-year on-levelled threshold
val uStar = years.map(y => tivIndex.suggestedNewThreshold(u, y)).max

// 2. On-level, keep losses above uStar
val onLevelledByYear = years
  .zip(rawLossesByYear)
  .map((y, xs) => xs.map(x => tivIndex.onLevel(value = x, fromYear = y)).filter(_ > uStar))
val counts = onLevelledByYear.map(_.length)
val ys = onLevelledByYear.flatten

// 3. Severity: Pareto tail index above uStar
val alpha = ys.length / ys.map(y => math.log(y / uStar)).sum

// 4. Frequency above uStar
val (freqAboveUStar, converged) = NegativeBinomial.mle(counts)
require(converged)

// 5. Forecast year above d
val d = 25.0e6
require(d >= uStar, "d below uStar needs extrapolation of the tail below where it was fitted")
val thin = math.pow(uStar / d, alpha)
val freqAboveD: Poisson | NegativeBinomial = freqAboveUStar match
  case nb: NegativeBinomial => NegativeBinomial(nb.a, nb.b * thin)
  case p: Poisson           => Poisson(p.lambda * thin)
val sevAboveD = Pareto(d, alpha)

The results:

years.map(y => f"$y: ${tivIndex.onLevelFactor(y)}%.3f").mkString(", ") // on-level factor per year
// res2: String = "2016: 1.909, 2017: 1.810, 2018: 1.694, 2019: 1.591, 2020: 1.500, 2021: 1.400, 2022: 1.296, 2023: 1.221, 2024: 1.141, 2025: 1.050"
uStar
// res3: Double = 1.909090909090909E7
counts
// res4: Array[Int] = Array(4, 9, 3, 9, 9, 8, 12, 6, 1, 12)
alpha
// res5: Double = 1.2108831561542586
freqAboveUStar
// res6: Poisson | NegativeBinomial = NegativeBinomial(
//   a = 7.345775033136287,
//   b = 0.9937685223234036
// )
freqAboveD
// res7: Poisson | NegativeBinomial = NegativeBinomial(
//   a = 7.345775033136287,
//   b = 0.7169264345294771
// )
sevAboveD
// res8: Pareto = Pareto(scale = 2.5E7, shape = 1.2108831561542586)

Checks before relying on it

Parameter uncertainty

The recipe gives a plug-in forecast. With 10–30 years of history, uncertainty in α̂, r and β is a material part of the forecast-year spread, especially in the tail. A simple way to include it is to bootstrap whole years and refit every step:

val resampler = new scala.util.Random(1)
val nYears = years.length

def resampledForecastCount(): Option[Int] =
  val years = Array.fill(nYears)(resampler.nextInt(nYears))
  val c = years.map(onLevelledByYear(_).length)
  if c.sum == 0 then None // no events above uStar in this resample
  else
    val ysB = years.flatMap(onLevelledByYear(_))
    val a = ysB.length / ysB.map(y => math.log(y / uStar)).sum
    val (f, _) = NegativeBinomial.mle(c)
    val p = math.pow(uStar / d, a)
    Some(f match
      case nb: NegativeBinomial => NegativeBinomial(nb.a, nb.b * p).draw
      case pois: Poisson        => Poisson(pois.lambda * p).draw
    )
  end if
end resampledForecastCount

val forecastCounts = Iterator.continually(resampledForecastCount()).flatten.take(5_000).toArray

forecastCounts is a sample from the forecast-year count distribution above d, including parameter uncertainty. Comparing its upper quantiles with the plug-in freqAboveD shows how much the plug-in understates:

def quantile(xs: Array[Int], q: Double): Int = xs.sorted.apply((q * (xs.length - 1)).round.toInt)

val plugIn = Array.fill(5_000)(freqAboveD match
  case nb: NegativeBinomial => nb.draw
  case p: Poisson           => p.draw
)
for q <- Seq(0.5, 0.9, 0.99) yield (q, quantile(plugIn, q), quantile(forecastCounts, q))
// res9: Seq[Tuple3[Double, Int, Int]] = List(
//   (0.5, 5, 5),
//   (0.9, 9, 9),
//   (0.99, 14, 14)
// )

Each tuple is (quantile, plug-in, with parameter uncertainty). Both columns come from random draws, so they move slightly between builds.

Pitfalls, in both directions

There is one correct basis: on-levelled losses above a threshold at which every year is complete. Errors come from adjusting too little, which keeps old years on the raw basis, or from adjusting too much or inconsistently. In the table, "old years" means the low-TIV years.

Mistake Frequency Severity
Raw counts above u understated; spurious upward trend, so β is inflated —
On-levelled counts above u, or any threshold below u* understated, less so than raw α̂ too low (tail too heavy)
Raw counts with the TIV ratio as volume λ too low if α > 1, too high if α < 1 —
On-levelled counts above u* and a TIV-ratio volume λ overstated (adjusted twice) —
Frequency on one basis, severity on another understated too heavy

Too little adjustment: staying on the raw basis

Too much, or mismatched, adjustment

Threshold placement

When TIV is irrelevant to the event count

For perils whose event count does not depend on the book, such as hurricane landfall counts, TIV plays no part in frequency at all. Count the events directly. Only the severity is on-levelled.