VaR & Expected Shortfall
Read a loss quantile and the tail beyond it.
01Compute historical VaR and ES
02Explain coherence and tail sensitivity
03Backtest exceptions without overclaiming
Define the exposure before compressing it into a metric.
VaR marks a threshold; Expected Shortfall asks how severe losses are after that threshold is crossed.
Both depend on horizon and confidence.
ES averages the tail.
Historical estimates inherit sample regime.
Fix portfolio, scenarios, horizon, and legal terms.
Market-risk limits, capital and scenario governance require transparent distributional summaries.
trading portfolios
risk-factor books
limit systems
Loss is positive; horizon, confidence and P&L method are displayed.
Aggregate with an explicit measure and convention.
Value at Risk
The smallest loss threshold covering α of the distribution.
Expected Shortfall
Average quantile across the remaining tail.
Short derivation
From information set to computable quantity
Each line states the information, measure and unit before manipulating the expression.
- 01
Construct loss sample
Map historical or simulated factor moves to portfolio P&L.
- 02
Sort losses
Use a declared empirical quantile convention.
- 03
Select VaR index
Choose the first order statistic meeting confidence α.
- 04
Average tail
Mean losses at or beyond the selected quantile, handling ties explicitly.
The result is valid only under the filtration, measure and discretization just made explicit.
Inputs
L: positive lossqα: α-quantile
Assumptions and limits
- Historical VaR misses unseen regimes.
- VaR is not subadditive in general.
Reconcile valuation, risk, and model limitations.
Revalue a fixed portfolio under a controlled loss sample, then compute empirical quantile and tail mean.
Select observation window, weighting and stress augmentation through a governed methodology.
06PYTHON IMPLEMENTATIONOpen the implementation and checks.
- Typed domain validation
- Deterministic seeded computation
- Readout plus invariant
VaR & Expected Shortfall
Reproduce the governing quantity, then challenge it with an invariant.
import numpy as np def varalphalinflpllel(x: np.ndarray) -> float: x = np.asarray(x, dtype=float) assert np.isfinite(x).all() return float(np.mean(x)) sample = np.array([0.8, 1.0, 1.2])value = varalphalinflpllel(sample)assert sample.min() <= value <= sample.max()print(f"value={value:.6f}")Move the state. Challenge the equation.
VaR & Expected Shortfall
Change scale, volatility, collateral and confidence. Exposure, tail and adjustment metrics respond from one synthetic portfolio.
Synthetic scenario losses with the selected historical VaR threshold.
- scenario loss
- VaR
Use Left/Right or Up/Down arrows to inspect values; Home and End jump to the bounds.
Scenario → distribution → decision
Legal terms and model state enter before the summary metric and its governance action.
18.00% volSynthetic market scenarios
0.35mUnsecured exposure boundary
1.24mDecision metric with explicit convention
Turn exposure into a controlled decision.
“A 99% number says almost nothing about the other 1% unless the tail is reported.”
P&L sample
confidence
horizon
Select observation window, weighting and stress augmentation through a governed methodology.
RISKtail concentration
backtest exceptions
- Validate market state and timestamp
- Recompute the baseline
- Run a controlled perturbation
- Explain P&L and residuals
Production failure modes
- Silent convention or measure changes
- Unstable numerics hidden by plausible prices
09MACRO CONNECTIONOpen the transmission channel.
Transmission from state to valuation
The causal chain separates the economic shock from the modelling response.
transmitscreates portfolio loss
transmitsdefines quantile and tail
outputconstrains risk appetite
10COMMON PITFALLSOpen the failure checklist.
Mixing return and loss signs
Comparing different horizons directly
11SOURCES / FURTHER READINGOpen sources and continue the track.
Measure theory, simulation and computational-finance lectures
The lesson uses original prose and a fresh typed implementation; the linked material is a research map, not copied product code.
- Source
- Computational Finance Course
- Author
- L. A. Grzelak
- Ref
- main