Skip to main content
AI Fin Hub

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.

Education, not investment advice. Past performance does not predict future results. How we check our numbers.

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

  1. 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.
  2. Pick the VaR confidence level: 95%, 97.5%, 99% or 99.5%.
  3. Read the Kupiec p-value: whether the number of exceptions matches the confidence level.
  4. Check the Christoffersen independence test (do exceptions cluster?) and the joint conditional-coverage test.
  5. Read the Basel traffic-light zone from the exception count. The Basel rule is defined for 99% VaR over 250 days.

The method, step by step

Backtest a value-at-risk model by comparing realized losses to the VaR level over time and counting breaches, then running a Kupiec test to check the breach frequency matches the confidence level and a Christoffersen test to check breaches are independent rather than clustered. Clustered breaches are the dangerous failure: a model that is right on average but wrong in bunches will fail exactly when it matters.

  1. Define the breach indicator

    For each period, mark a breach when the realized loss exceeds the VaR forecast for that period. This produces a sequence of zeros and ones, the breach indicator, which is the raw material for every VaR backtest. The VaR confidence level sets the expected breach rate: a 99 percent one-day VaR should be breached on about one percent of days. Everything downstream tests whether this sequence behaves the way the model claims.

    Use out-of-sample VaR forecasts. Backtesting a VaR model on the same data it was fit on overstates how well it works, just like any other backtest.

  2. Run the Kupiec frequency test

    The Kupiec proportion-of-failures test checks whether the observed breach rate matches the expected rate implied by the confidence level. Too many breaches means the model understates risk; too few means it overstates risk and ties up capital needlessly. The test produces a statistic and a p-value for the null hypothesis that the breach frequency is correct. It is the first gate: a model that fails frequency is mis-scaled before you even look at timing.

    Too few breaches is a real failure too, not a free pass. An overly conservative VaR wastes capital and signals the model is not capturing the actual distribution.

  3. Run the Christoffersen independence test

    Passing the frequency test is not enough, because breaches can occur at the right rate but bunch together in stressed periods. The Christoffersen test checks whether a breach today is independent of a breach yesterday. If breaches cluster, the model has the right average but the wrong dynamics: it underestimates risk precisely when volatility spikes. Independence is the property that tells you the model holds up in the conditions you most need it to.

    Clustered breaches mean your VaR is calm until it is suddenly very wrong, all at once. That is the failure mode that causes blowups.

  4. Combine frequency and independence

    The Christoffersen conditional-coverage test combines both properties into one: correct breach frequency and independent breaches. A model must pass both to be trustworthy. Passing only frequency means the average is right but the timing is dangerous; passing only independence is meaningless if the rate is wrong. Read the combined test as the headline result, then use the individual tests to diagnose which property failed when it does.

    When the combined test fails, look at the components to localize the problem. Frequency failure is a scaling issue; independence failure is a dynamics issue, and they need different fixes.

  5. Act on the diagnosis

    A frequency failure usually means recalibrating the VaR level or the distributional assumption. An independence failure usually means the model is not capturing volatility clustering, which calls for a model that updates its risk estimate as volatility changes rather than a static one. Either way, the backtest does not just pass or fail; it points at what to fix. Re-run the tests after the fix on fresh data to confirm the correction held.

    Independence failures point toward a volatility-aware model. A static VaR that ignores changing volatility will keep clustering breaches no matter how you rescale it.

Sources: Techniques for Verifying the Accuracy of Risk Measurement Models (Paul H. Kupiec, Federal Reserve (1995)) ; Evaluating Interval Forecasts (Peter F. Christoffersen, International Economic Review (1998))

Mistakes that undo the result

Testing only breach frequency

A model can breach at exactly the right rate while bunching all the breaches into stressed periods. Frequency alone misses this, and clustered breaches are the failure mode that causes losses to arrive all at once.

Treating too few breaches as success

An overly conservative VaR that rarely breaches is not capturing the real distribution; it ties up capital and signals the model is mis-specified, which the frequency test correctly flags as a failure.

Backtesting VaR on in-sample data

Evaluating a VaR model on the data it was calibrated to overstates its accuracy. The breach behavior must be tested on out-of-sample forecasts to reflect how the model performs on unseen markets.

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.

  • 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 a benchmark-relative block when you include one.

  • Playgrounds Calibration Dojo

    Train your probabilistic intuition. Answer binary forecasting questions at any confidence level; track Brier score and reliability curve over time. All state stored locally.

All articles

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";

Input and output contract and the guide for agents.