Skip to main content

Module risk

Module risk 

Source
Expand description

Risk measures on sorted draws, and the exponential-utility measures (entropic, Esscher) on any draws.

These are the single implementation every domain uses: reserving, aggregate and capital call them instead of computing their own quantiles (see docs/design/predictive-distribution.md).

Both measures treat the draws as an empirical distribution with mass 1/n on each draw, so ties and atoms are handled exactly.

Functions§

entropic
Entropic risk measure (1/θ) log E[e^(θX)] of equally likely draws (losses positive), the certainty equivalent under exponential utility with risk aversion θ > 0. It increases from the mean (θ → 0) to the largest draw (θ → ∞); for a normal X it is μ + θσ²/2. Convex and translation-invariant, but not positively homogeneous.
esscher
Esscher premium E[X e^(hX)] / E[e^(hX)] of equally likely draws: the mean under the Esscher transform, which tilts probability towards large losses for h > 0 (the mean at h = 0; μ + hσ² for a normal X).
tvar_sorted
Tail value at risk: the mean of the worst 1 - p of the distribution, (1 / (1 - p)) * integral from p to 1 of VaR(u) du.
var_sorted
Value at risk: the smallest draw x with P(X <= x) >= p, the inverse of the empirical distribution function (numpy.quantile(..., method="inverted_cdf"), R quantile(..., type = 1)).