Expand description
Value-at-Risk and Expected Shortfall in the three standard flavors: historical (empirical), parametric normal (with a Cornish-Fisher higher-moment correction), and delta-normal for multi-asset books.
Conventions: confidence is the one-sided level (0.99 = 99%), and
both VaR and ES are reported as positive loss amounts in the P&L
currency. ES is always >= VaR at the same level (asserted in tests).
Structs§
- Delta
Normal Var - Delta-normal (variance-covariance) VaR of a linear book with the Euler decomposition into per-position components.
Functions§
- cornish_
fisher_ var - Cornish-Fisher VaR: the normal quantile adjusted for the sample’s
skewness and excess kurtosis — a standard desk correction for fat,
asymmetric P&L. With zero skew and excess kurtosis it reduces to
parametric_var. - delta_
normal_ var - Delta-normal VaR:
exposures[i]is the currency P&L per unit return of asseti(delta x spot),covariancethe per-horizon return covariance matrix. - historical_
expected_ shortfall - Historical Expected Shortfall: the average loss at or beyond the VaR quantile.
- historical_
var - Historical (empirical) VaR from a P&L sample.
- parametric_
expected_ shortfall - Parametric Expected Shortfall under normal P&L:
ES = -mean + std * phi(z_alpha) / (1 - alpha). - parametric_
var - Parametric VaR under normal P&L with the given
meanandstd.VaR = -mean + std * z_alpha.