Playground
VaR Backtest — Kupiec & Christoffersen
Paste P&L + VaR series and run Kupiec POF, Christoffersen independence, and joint conditional-coverage tests. Likelihood-ratio χ² p-values.
Runs in your browser. Nothing you enter is uploaded, and no account or API key is needed.
Inputs
One row per day. P&L is negative for a loss; VaR is the forecast loss as a positive number in the same units. An exception is a day where the loss exceeds VaR.
VaR confidence level
Kupiec p-value
0.034
36/500 exceptions (7.20%) vs expected 5.00%. The exception count is inconsistent with the stated confidence level (p < 0.05).
Basel traffic light: yellow (P(≤ 36 exceptions | model correct) = 98.76%).
Test results
Kupiec POF (LR_uc)
4.51
p = 0.034
Christoffersen Ind.
0.10
p = 0.754
Joint Cond. Coverage
4.61
p = 0.100
Interpretation
- Kupiec POF — tests whether the count of exceptions matches the expected rate.
- Christoffersen independence — tests whether exceptions cluster (consecutive) more than chance allows.
- Joint LR — combines both: a model can pass count yet fail clustering, or vice versa.
- Basel traffic light — green below 95% cumulative binomial probability of the exception count, yellow below 99.99%, red above; defined by the Basel Committee for 99% VaR over 250 days.
How to use it
- Paste one row per day with date, P&L (negative for a loss) and the VaR forecast as a positive loss. A clustered-exceptions demo loads by default.
- Pick the VaR confidence level: 95%, 97.5%, 99% or 99.5%.
- Read the Kupiec p-value: whether the number of exceptions matches the confidence level.
- Check the Christoffersen independence test (do exceptions cluster?) and the joint conditional-coverage test.
- Read the Basel traffic-light zone from the exception count. The Basel rule is defined for 99% VaR over 250 days.
Questions people ask
What do the Kupiec and Christoffersen tests check?
Kupiec's POF (1995) tests whether the realized rate of VaR violations matches the stated confidence level. If you ran 95% VaR and observed 12% violations, Kupiec rejects. Christoffersen (1998) extends this by also testing whether violations are independent — clustered violations fail the independence test even if the unconditional rate is correct.
Why do both tests matter?
A model can pass Kupiec (right number of violations on average) but fail Christoffersen (violations cluster during volatile periods). Clustered violations mean the model is mis-specified during regime changes. Both passing is necessary to declare a VaR model adequate.
How many days of backtest do I need?
The Basel framework uses 250 trading days. The tool needs at least 30 paired observations, but the tests have little power on short samples: at 95% VaR over 250 days you expect about 12.5 exceptions, and only a large miscalibration shows up as a rejection. The tool does not flag short samples, so read the p-values against the sample length.
What's the 'green/yellow/red' zone?
The Basel Committee's traffic light for 99% VaR over 250 days: green for 0 to 4 exceptions, yellow for 5 to 9 (a higher capital multiplier), red for 10 or more. The tool shows the zone using the rule behind those bands, so it works at any length and confidence level: green while the probability of seeing that many or fewer exceptions under a correct model is below 95%, yellow below 99.99%, red above.
Does it handle Conditional VaR (Expected Shortfall)?
No. The tool backtests VaR exceptions only. Expected Shortfall backtests, such as Acerbi and Székely's tests, need the size of each loss beyond VaR and are not implemented.
Guides, formulas and worked examples
- Guide How to Backtest a Value-at-Risk Model
- Comparison Historical vs Parametric VaR
- Comparison Monte Carlo vs Historical VaR
- Comparison VaR vs CVaR (Expected Shortfall)
- Formula CVaR / Expected Shortfall Formula
- Formula Historical VaR Formula
- Formula Parametric VaR Formula
- Examples VaR Backtest (Kupiec, Christoffersen): Examples
- Checklist Risk Model Validation Checklist
Related tools
- Calculators Returns Distribution Analyzer
Paste a returns CSV. Histogram, normal QQ plot, skewness, excess kurtosis, Jarque-Bera test, tail-weight index. See why Sharpe alone misleads.
- Calculators Risk-Adjusted Returns Calculator
Paste a returns CSV. Sharpe, Sortino, Calmar, Omega, alpha, beta, tracking error, information ratio, max drawdown, and tail moments — plus.
- Playgrounds Calibration Dojo
Train your probabilistic intuition. Answer binary forecasting questions at any confidence level; track Brier score and reliability curve over time. All.
Articles
- 12 min read Model Selection Framework for Finance Tasks
A task × latency × cost × context decision tree for finance LLM workloads. Ten concrete scenarios mapped to tier bands. Grounded in published pricing, not.
- 11 min read Drawdown Markov vs Historical Bootstrap: Tape-Length Decision
Engine returns p95 recovery 28 months on canonical input; Markov beats bootstrap on tapes under 60 months and loses on tapes over 240 months.
- 7 min read Kupiec vs Bootstrap for VaR Validation
30-day VaR backtest: 7 exceptions vs 0.3 expected, Kupiec LR 32.34, p 1.3e-8. Bootstrap agrees but converges slower. Basel III names Kupiec.
Use it from code
The same calculation as a JavaScript module you can import. It runs where you import it, with no request, key or rate limit.
import { compute } from "https://aifinhub.io/engines/var-backtest-kupiec-christoffersen.js";