Skip to main content

Module evt

Module evt 

Source
Expand description

Extreme value tails: a generalized Pareto distribution (GPD) fitted to the exceedances over a threshold, for VaR and TVaR beyond the draws.

Peaks over threshold: above a high threshold u, X - u given X > u is approximately GPD (Pickands–Balkema–de Haan). The tail model is P(X > x) = p_u (1 + ξ (x - u) / β)^(-1/ξ) for x >= u, with p_u the share of draws above u (see docs/design/risk.md).

Structs§

Gpd
The generalized Pareto distribution with shape xi, scale beta and location u (0 unless set), on x >= u (and x <= u - beta / xi when xi < 0), as SciPy’s genpareto(c=xi, loc=u, scale=beta).
PotTail
A peaks-over-threshold tail: draws above threshold modelled by a GPD.

Functions§

hill
Hill estimates of the tail index ξ (1/α for a Pareto tail) from the k largest draws, for each k in ks: ξ̂_k = (1/k) Σ_{i=1..k} ln X_(n-i+1) - ln X_(n-k).
mean_excess
The empirical mean-excess function e(u) = E[X - u | X > u] at each threshold, with the number of draws above it: (u, e(u), n_u), e(u) NaN where no draw exceeds u.