FreqSev

vecxt_re.FreqSev
See theFreqSev companion object
case class FreqSev(frequency: Poisson | NegativeBinomial, severity: Mixed)

Collective risk model: a claim-count (frequency) distribution paired with a per-claim severity distribution.

The aggregate loss is $S = \sum_{i=1}^{N} X_i$ with $N$ drawn from frequency and the $X_i$ iid from severity.

Serialises to JSON with only the distribution parameters; the frequency carries a "type" discriminator so the Poisson / Negative Binomial choice survives a round trip:

{
 "frequency": {"type": "NegativeBinomial", "a": 2.0, "b": 0.5},
 "severity": {"empirical": {"values": [...], "weights": [...]}, "mixingPoint": 1e6, "paretoShape": 1.8}
}

Value parameters

frequency

The claim-count distribution

severity

The per-claim loss distribution

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def draw: Array[Double]

Simulate the individual losses of a single period.

Simulate the individual losses of a single period.

Attributes

def drawAggregate: Double

Simulate the aggregate loss of a single period.

Simulate the aggregate loss of a single period.

Attributes

def drawScenarr(numberIterations: Int, day1: LocalDate = ..., name: String = ..., threshold: Double = ...): Scenarr

Simulate numberIterations one-year periods as a Scenarr, ready for the reinsurance calculations (e.g. tower.splitScenarioAmounts).

Simulate numberIterations one-year periods as a Scenarr, ready for the reinsurance calculations (e.g. tower.splitScenarioAmounts).

  1. For each iteration, draw the number of claims from frequency.
  2. For each claim, draw a severity.
  3. For each claim, draw a day of occurrence, uniform over the year starting at day1 (0-based: day 0 is day1).
  4. Unfold the claim counts into a contiguous iteration column (1-based), e.g. counts [2, 0, 1] become iterations [1, 1, 3].

Days are sorted within each iteration so the result is sorted by iteration then day.

The frequency is taken to count claims in excess of threshold, so every drawn severity must exceed it. Claims are never dropped (that would understate the frequency); an IllegalStateException is thrown if any severity draw is at or below threshold.

val scenarr = freqSev.drawScenarr(numberIterations = 10000, day1 = LocalDate.of(2026, 1, 1), name = "property")

Value parameters

day1

The first day of the simulated year

name

Name of the resulting Scenarr

numberIterations

Number of simulated years

threshold

Reporting threshold; the severity must only generate losses strictly above it

Attributes

def mean: Double

Expected aggregate loss, $E[S] = E[N] , E[X]$.

Expected aggregate loss, $E[S] = E[N] , E[X]$.

Attributes

def variance: Double

Aggregate loss variance, $Var(S) = E[N] , Var(X) + Var(N) , E[X]^2$. Infinite when the severity variance is.

Aggregate loss variance, $Var(S) = E[N] , Var(X) + Var(N) , E[X]^2$. Infinite when the severity variance is.

Attributes

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product