Skip to main content

Module measures

Module measures 

Source
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§

DeltaNormalVar
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 asset i (delta x spot), covariance the 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 mean and std. VaR = -mean + std * z_alpha.