ReReporting

vecxt_re.ReReporting
object ReReporting

Per-layer loss metrics over a simulation.

Precondition for every method taking years: years(i) is the 1-based iteration of cededToLayer(i), the two arrays have the same length, years is sorted in non-decreasing order, and every value is in 1..numIterations. Arrays that come from a Scenario, or a Scenarr with isSorted = true, already satisfy this.

lossReport checks the precondition and throws IllegalArgumentException if it is broken. The check costs nothing extra: its single pass only consumes years(i) when it equals the current iteration, so leftover entries at the end mean years was unsorted or out of range.

The group-sum based methods (attachmentProbability, exhaustionProbability, std) do NOT check it, because checking would add a second full pass. Unsorted years silently gives wrong numbers there: they keep only the last run of each iteration (see groupSums.scala).

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Extensions

Extensions

extension (calcd: (layer: Layer, cededToLayer: Array[Double]))
inline def attachmentProbability(numIterations: Int, years: Array[Int]): Double
inline def exhaustionProbability(numIterations: Int, years: Array[Int]): Double
inline def expectedLoss(numIterations: Int): Double
inline def lossReport(numIterations: Int, years: Array[Int], limit: ReportDenominator): (name: String, limit: Double, el: Double, stdDev: Double, attachProb: Double, exhaustProb: Double)

Efficient single-pass loss report computation.

Efficient single-pass loss report computation.

This method computes all loss metrics (EL, std, attachment probability, exhaustion probability) in a single pass through the data, using Welford's online algorithm for numerically stable variance computation.

This is significantly more efficient than calling the individual metric methods separately, as it avoids multiple iterations through the grouped sums.

Value parameters

limit

Report denominator for normalizing EL and std. For FirstLimit / AggLimit the ceded amounts are divided by limit * share, so el and stdDev are share-independent; see ReportDenominator.

numIterations

Number of simulation iterations

years

Sorted array of 1-based iteration indices, one per element of cededToLayer. Checked: see the object doc.

Attributes

Returns

Named tuple with (name, limit, el, stdDev, attachProb, exhaustProb). limit is the full (100%) limit.

inline def std(numIterations: Int, years: Array[Int]): Double