Hexa Scholar

What VaR exceptions reveal in a backtest

A navy stone seawall with a gold measuring post stands in a choppy sea; waves splash over the top at two separate places while a keeper with a notebook watches from the end of the wall.
A seawall that the sea tops now and then, and a keeper who writes it down.

The question

Two desks each had 5 exceptions of their 99% VaR in 250 trading days. Can the order of those days make one record worse?

Judge three pairs of records, then see what two standard tests say.

  1. 1 SeeJudge three pairs of exception records.
  2. 2 TryProbe how the coverage test behaves.
  3. 3 ProveBuild the proof, line by line.
  4. 4 ApplyStatistics, p-values and a desk's record.
Before you start · 3 quick checks on VaR exceptions, a likelihood ratio statistic and lag-1 autocorrelation, about 3 min

Two ideas before you start

2 ideas

An exception is a day the loss is above the VaR

Figure: twenty daily losses as bars and the model's VaR as a dashed line; bars above the line are exceptions. It needs JavaScript.

VaR level:

VaR: $1.5 million exceptions on days 9 and 15 x = 2 of 20

Each morning the model gives a VaR for the day. An exception is a day whose loss turns out larger than that VaR. A loss equal to the VaR, like day 12 at 95%, whose bar just reaches the line, is not an exception.

Exact definition

Losses and VaR. Let \(L_t\) be the loss on day \(t\), that is, minus the change in the portfolio's value over the day, and let \(\operatorname{VaR}_t\) be the model's VaR at confidence level \(\alpha\) for day \(t\), computed from what is known before day \(t\). The lesson on value at risk defines \[\begin{aligned} &\operatorname{VaR}_\alpha(L) \\ &= \inf\{x : F_L(x) \ge \alpha\}. \end{aligned}\] Write \(p = 1 - \alpha\): \(p = 0.01\) for a 99% VaR.

Hits and exceptions. The hit of day \(t\) is \(I_t = 1\) if \(L_t \gt \operatorname{VaR}_t\), an exception, and \(I_t = 0\) otherwise, a calm day. A backtest over days \(1, \dots, n\) records the hits \(I_1, \dots, I_n\) and counts \(x = I_1 + \dots + I_n\) exceptions. The model claims that each day's loss is above its VaR with probability \(p\).

The card's figure uses twenty made-up losses in millions of dollars and one VaR for every day, so the picture stays simple; a real model's VaR changes from day to day.

Pair each day with the day before

Figure: twelve days as squares, exception days filled, and below each pair of neighboring days its kind, 00, 01, 10 or 11. It needs JavaScript.

Record:

11 pairs: n₀₀ = 5 n₀₁ = 3 n₁₀ = 3 n₁₁ = 0

Each record has 3 exceptions in 12 days. Its 11 pairs of neighboring days are of four kinds: calm then calm (00), calm then exception (01), exception then calm (10) and exception then exception (11).

Exact definition

Transition counts. For a record of hits \(I_1, \dots, I_n\) and \(i, j\) in \(\{0, 1\}\), \(n_{ij}\) is the number of days \(t = 2, \dots, n\) with \(I_{t-1} = i\) and \(I_t = j\). Each of the \(n - 1\) transitions from one day to the next is counted once, so \[\begin{aligned} &n_{00} + n_{01} + n_{10} + n_{11} \\ &= n - 1. \end{aligned}\]

Day 1 is counted only as a day before, and day \(n\) only as a day after. The dashed mark in the figure joins two exceptions in a row, a transition of kind 11.

Fine print: what a backtest compares

A backtest compares each day's VaR, fixed before the day, with the loss that followed. It judges the model only through the hits: how large the losses on exception days were does not enter the two tests on this page. The lesson on expected shortfall looks at the size of the tail.

The records in 1 See and the problems are constructed examples, not market data. Every probability statement on the page assumes the hits come from a model stated next to it.

1 See

Which record is stronger evidence?

How the rounds are judged

Every desk reports a 1-day VaR at the 99% level, so the model claims an exception probability of \(p = 0.01\) per day. In every round both desks have the same number of exceptions. The page computes, for each record, the coverage statistic and the independence statistic described after your first pick; the record whose two statistics add up to more is the stronger evidence, and equal sums are equal evidence.

The records were written by hand to make the point of each round; they are not simulated, and your pick is judged by the exact values of the two statistics.

2 Try

The coverage test up close

A question first. The explorer below it opens once you check your answer.

A model that is off

Predict first; the second explorer opens when you check.

3 Prove

Why the independence statistic is never negative

Theorem

Assumptions. \(I_1, \dots, I_n\) is a record of hits, 0 or 1, with \(n \ge 3\). For \(i, j\) in \(\{0, 1\}\), \(n_{ij}\) is the number of days \(t = 2, \dots, n\) with \(I_{t-1} = i\) and \(I_t = j\), so the four counts add up to \(n - 1\), and \(x = I_1 + \dots + I_n\). At least one transition starts on a calm day and at least one on an exception day: \(n_{00} + n_{01} \ge 1\) and \(n_{10} + n_{11} \ge 1\). Let

\[\begin{aligned} \hat{\pi}_0 &= \frac{n_{01}}{n_{00} + n_{01}}, \\ \hat{\pi}_1 &= \frac{n_{11}}{n_{10} + n_{11}}, \\ \hat{\pi} &= \frac{n_{01} + n_{11}}{n - 1}. \end{aligned}\]

For counts \(m_0, m_1 \ge 0\) with \(m = m_0 + m_1 \ge 1\), write \(\hat{u} = m_1/m\) and \(h(u) = m_0\ln(1 - u) + m_1\ln u\) for \(0 \le u \le 1\), with \(0 \ln 0 = 0\) and \(\ln 0 = -\infty\). \(h_0\) and \(h_1\) are \(h\) with the counts \((n_{00}, n_{01})\) and \((n_{10}, n_{11})\), and \(\ell(a, b) = h_0(a) + h_1(b)\) for \(0 \le a, b \le 1\): the log-likelihood of the record, given day 1, when the chance of an exception is \(a\) after a calm day and \(b\) after an exception day. Finally

\[\begin{aligned} &\operatorname{LR}_{\mathrm{ind}} \\ &= 2[\ell(\hat{\pi}_0, \hat{\pi}_1) - \ell(\hat{\pi}, \hat{\pi})]. \end{aligned}\]

Conclusion. \(\ell(a, b) \le \ell(\hat{\pi}_0, \hat{\pi}_1)\) for all \(a, b\) in \([0, 1]\). So \(\operatorname{LR}_{\mathrm{ind}} \ge 0\), and \(\operatorname{LR}_{\mathrm{ind}} = 0\) exactly when \(\hat{\pi}_0 = \hat{\pi}_1\).

Facts the proof uses.

  1. \(\ln y \le y - 1\) for every \(y \gt 0\), with equality only at \(y = 1\): \(\ln\) is concave and \(y - 1\) is its tangent line at \(y = 1\).
  2. The convention \(0 \ln 0 = 0\), so a term whose count is 0 drops out.
  3. Ordinary algebra of numbers.

Each option is one step of the proof. Pick the one that is true for all counts the line allows (lines 1 to 3: \(m_0, m_1 \ge 1\); lines 4 and 5: every record of the theorem) and for every \(u\), \(c\), \(a\) or \(b\) in the range it states.

What else follows
4 Apply

Problems

The two statistics are defined in 1 See, the binomial count in 2 Try and the joint test in 3 Prove. Each problem has hints and a full solution.

Key point A VaR backtest reads the hits. Count the exceptions for \(\operatorname{LR}_{\mathrm{pof}}\), count the four kinds of transitions for \(\operatorname{LR}_{\mathrm{ind}}\), and compare each with the 95% point of \(\chi^2_1\), or their sum with that of \(\chi^2_2\). With one or two years of data the tests miss many flawed models, so a pass is weak evidence.
Level Intermediate Prerequisites value at risk, likelihood ratio tests and autocorrelation; each is refreshed in Before you start Time ~35 min

Further reading