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, scalebetaand locationu(0 unless set), onx >= u(andx <= u - beta / xiwhenxi < 0), as SciPy’sgenpareto(c=xi, loc=u, scale=beta). - PotTail
- A peaks-over-threshold tail: draws above
thresholdmodelled by a GPD.
Functions§
- hill
- Hill estimates of the tail index
ξ(1/αfor a Pareto tail) from theklargest draws, for eachkinks:ξ̂_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 exceedsu.