VaR backtesting traffic light
A VaR backtest counts the days on which the loss exceeded the VaR and asks whether that count is plausible for the stated confidence level. This tool gives the Basel traffic-light zone and capital plus factor for the standard 250-day, 99% test. It also gives the Kupiec proportion-of-failures test and the binomial probability for any window and level. It reads the result in both directions: too many exceptions suggest the model understates risk, and too few suggest it is overconservative.
Results
Basel traffic light · T = 250 · 99%
Green zone
Plus factor
+0.00
Two-sided reading · too few
Suspiciously few exceptions: 0 observed against 2.5 expected. The model may be overconservative, which overstates capital and can hide a mis-specified distribution.
01Inputs
Inputs
- Observations T
- Number of trading days in the backtest window. The Basel zones apply only at T = 250.
- Confidence level
- The VaR confidence level, e.g. 99%. The exception probability under the null is p = 1 − confidence.
- Exceptions x
- Days on which the loss exceeded VaR. Entered directly or counted from your file.
- P&L and VaR data (optional)
- CSV with
pnl,varordate,pnl,var. VaR as a positive number. Parsed locally.
02Outputs
Outputs
- Traffic-light zone and plus factor
- Green 0–4, yellow 5–9, red 10 or more, with plus factors 0, 0.40–0.85 and 1.00. Shown only at T = 250, 99%.
- Kupiec LR and p-value
- The likelihood-ratio statistic and its χ²(1) p-value. Finite at x = 0 and x = T.
- P(X ≤ x)
- Binomial cumulative probability of observing x or fewer exceptions if the model is correct.
- Two-sided reading
- Flags too many and suspiciously few exceptions at the 5% level.
03Formulas
Formulas
Under the null hypothesis that the model is correctly calibrated, exceptions are binomial:
Kupiec’s proportion-of-failures statistic, with :
The terms use the convention 0 · ln 0 = 0, so the statistic is finite at the edges:
Basel traffic light for T = 250 at 99%, with the multiplier 3 + plus factor:
| Zone | Exceptions | Plus factor |
|---|---|---|
| Green | 0–4 | 0.00 |
| Yellow | 5 / 6 / 7 / 8 / 9 | 0.40 / 0.50 / 0.65 / 0.75 / 0.85 |
| Red | 10+ | 1.00 |
How this works
- An exception is a day on which the loss, −P&L, is strictly greater than VaR.
- The Basel zone is a lookup on the count, valid only for 250 observations of 99% VaR.
- The Kupiec test compares the likelihood of the observed exception rate under p with its likelihood under the maximum-likelihood rate x/T. Under the null, LR is approximately χ² with one degree of freedom; the p-value is P(χ²₁ ≥ LR) = erfc(√(LR/2)).
- The reading is two-sided at 5%. With T = 250 at 99% the expected count is 2.5. Zero exceptions gives LR = 5.03 and p = 0.025: a rejection, on the side of overconservatism.
- Kupiec tests only the frequency of exceptions, not whether they cluster. Pair it with an independence test, such as Christoffersen’s, before drawing conclusions about the model.
The zone thresholds come from the Basel Committee’s 1996 supervisory framework for the use of backtesting. FRTB retains a traffic-light approach for the bank-wide backtest of internal models.