Unit 11, lesson 87

Risk backtesting and statistical tests

How VaR exceptions become Bernoulli observations, why their count is binomial, and how the unconditional coverage, independence and conditional coverage tests are derived and read.

  • Video 87
  • Backtesting and model uncertainty

A one-day 95 percent VaR forecast was exceeded on 12 of the last 100 trading days, where a correct forecast leads one to expect 5. Is that more than bad luck, and would the verdict change if the 12 exceptions had all come in one bad fortnight? Frequency and timing are separate questions with separate tests. This lesson turns exceptions into Bernoulli observations, derives the binomial count and the likelihood ratio test of unconditional coverage, and builds the transition count tests of independence and conditional coverage, saying which reference distributions are exact and which hold only in large samples.

Key terms

VaR backtesting

Definition Let LtL_t be the loss of a fixed portfolio over period tt, positive for an adverse outcome, so Lt=−ΔVtL_t = -\Delta V_t when ΔVt\Delta V_t is the PnL of the period. Let Ft−1\mathcal{F}_{t-1} be the information available when the forecast for period tt is issued, and let

Ft(x)=P(Lt≤x∣Ft−1)F_t(x) = \mathbb{P}(L_t \le x \mid \mathcal{F}_{t-1})

be the conditional distribution function of the loss under the physical measure P\mathbb{P}, the right measure here because forecasts are compared with realized losses. A VaR forecast at confidence level α∈(0,1)\alpha \in (0, 1) is an Ft−1\mathcal{F}_{t-1}-measurable number VaR⁡α,t\operatorname{VaR}_{\alpha,t} that is meant to equal the lower conditional quantile

VaR⁡α,t=inf⁡{x:Ft(x)≥α}.\begin{aligned} &\operatorname{VaR}_{\alpha,t} \\[0.4em] &= \inf\{x : F_t(x) \ge \alpha\}. \end{aligned}

A VaR backtest uses the forecasts and the realized losses of periods t=1,…,nt = 1, \dots, n to test a stated hypothesis about the exceptions, the periods in which the loss exceeds its forecast. The hypothesis usually tested is correct conditional coverage at a stated rate p0p_0,

P(Lt>VaR⁡α,t∣Ft−1)=p0for every t,\begin{aligned} &\mathbb{P}(L_t > \operatorname{VaR}_{\alpha,t} \mid \mathcal{F}_{t-1}) \\[0.4em] &\quad = p_0 \quad \text{for every } t, \end{aligned}

where p0=1−αp_0 = 1 - \alpha for forecasts that equal the conditional quantile of continuous conditional loss laws. The loss must be measured over the horizon of the forecast and on the portfolio it was made for, and the forecast must be the one issued at time t−1t - 1, not a version recomputed later with data that include LtL_t. A rejection is evidence against the tested hypothesis. A nonrejection in a short sample does not show that the forecasts are correct.

In plain words A 95 percent VaR promises that, whatever happened before, the next loss exceeds the forecast with probability 5 percent. A backtest holds the forecaster to that promise using the record, and asks both how often the promise failed and whether the failures came in bunches.

Example In a constructed model, daily losses are independent and identically distributed with finite variance, and every day a 10-day VaR is forecast for the next 10 days. Two windows that start one day apart share 9 of their 10 daily losses, so their 10-day losses have correlation 9/109/10. With normal daily losses, each 10-day forecast can be the exact 99 percent quantile, and still an exception in one window is followed by an exception in the next window with probability about 0.540.54, against 0.010.01 without the overlap. The outcome of a window is not yet known when the next forecast is issued, so the forecasts can all be correct while the exceptions are strongly dependent. Tests that assume independent exceptions then need nonoverlapping windows, which leave about one tenth as many observations, or a reference distribution that allows for the overlap.

Exception indicator

Definition The exception indicator of period tt is

It=1{Lt>VaR⁡α,t},I_t = \mathbf{1}_{\{L_t > \operatorname{VaR}_{\alpha,t}\}},

which is 11 when the realized loss strictly exceeds the forecast and 00 otherwise. If the forecast equals the lower conditional quantile, then Ft(VaR⁡α,t)≥αF_t(\operatorname{VaR}_{\alpha,t}) \ge \alpha by the right continuity of FtF_t, so

P(It=1∣Ft−1)=1−Ft(VaR⁡α,t)≤1−α,\begin{aligned} &\mathbb{P}(I_t = 1 \mid \mathcal{F}_{t-1}) \\[0.4em] &= 1 - F_t(\operatorname{VaR}_{\alpha,t}) \le 1 - \alpha, \end{aligned}

with equality exactly when Ft(VaR⁡α,t)=αF_t(\operatorname{VaR}_{\alpha,t}) = \alpha, in particular whenever FtF_t is continuous. An atom of the loss law at the quantile makes the exception probability smaller than 1−α1 - \alpha, and a test must then use the actual probability. Now suppose that P(It=1∣Ft−1)=p0\mathbb{P}(I_t = 1 \mid \mathcal{F}_{t-1}) = p_0 for every tt, and that every earlier indicator IsI_s with s<ts < t is known when the forecast for period tt is issued, that is, Ft−1\mathcal{F}_{t-1}-measurable. Fix i1,…,in∈{0,1}i_1, \dots, i_n \in \{0, 1\} and write AjA_j for the event {I1=i1,…,Ij=ij}\{I_1 = i_1, \dots, I_j = i_j\}. The event An−1A_{n-1} belongs to Fn−1\mathcal{F}_{n-1}, so conditioning on Fn−1\mathcal{F}_{n-1} gives

P(An)=p0in(1−p0)1−in×P(An−1),\begin{aligned} \mathbb{P}(A_n) &= p_0^{i_n}(1 - p_0)^{1 - i_n} \\[0.4em] &\quad \times \mathbb{P}(A_{n-1}), \end{aligned}

and induction on nn turns the right side into a product of nn Bernoulli probabilities. So correct conditional coverage makes the indicators independent Bernoulli variables with parameter p0p_0, which is the null hypothesis of the tests below. The overlapping windows of the previous card break the measurability condition, which is why their exceptions can be dependent.

In plain words The indicator turns each period into a yes or no answer to one question, whether the loss broke through the forecast. When the forecasts are correct, the loss laws have no atoms and each answer is known before the next forecast is made, these answers behave like independent coin tosses that come up yes with probability 1−α1 - \alpha.

Example A constructed loan position loses nothing over the next period with probability 0.970.97 and 6060 currency units with probability 0.030.03. Its distribution function equals 0.970.97 at 00, so the 95 percent VaR is inf⁡{x:F(x)≥0.95}=0\inf\{x : F(x) \ge 0.95\} = 0. The strict exception L>0L > 0 has probability 0.030.03, not 0.050.05, so a correct forecast produces exceptions at the rate 0.030.03, and a test against p0=0.05p_0 = 0.05 would treat the low exception rate of a correct forecast as evidence against it. With the rule L≥VaR⁡L \ge \operatorname{VaR} instead, every period would be an exception, since the loss is never negative.

Binomial exception count

Definition The exception count over nn periods is K=∑t=1nItK = \sum_{t=1}^{n} I_t. If I1,…,InI_1, \dots, I_n are independent Bernoulli variables with parameter p0p_0, then KK has the distribution Binomial⁡(n,p0)\operatorname{Binomial}(n, p_0),

P(K=j)=(nj)p0j×(1−p0)n−j\begin{aligned} \mathbb{P}(K = j) &= \binom{n}{j} p_0^{j} \\[0.4em] &\quad \times (1 - p_0)^{n - j} \end{aligned}

for j=0,1,…,nj = 0, 1, \dots, n, with E[K]=np0\mathbb{E}[K] = n p_0 and Var⁡(K)=np0(1−p0)\operatorname{Var}(K) = n p_0 (1 - p_0). The exact upper tail

P(K≥k)=∑j=knP(K=j)\mathbb{P}(K \ge k) = \sum_{j=k}^{n} \mathbb{P}(K = j)

measures how surprising kk or more exceptions are under this null. A one-sided exact test at a significance level aa for too many exceptions rejects when P(K≥k)≤a\mathbb{P}(K \ge k) \le a for the observed count kk. Because KK is discrete, the actual size of this test is the upper tail at the smallest rejected count, which is at most aa and usually below it. Without independence the count need not be binomial, since in general

Var⁡(K)=∑t=1nVar⁡(It)+2∑s<tCov⁡(Is,It),\begin{aligned} \operatorname{Var}(K) &= \sum_{t=1}^{n} \operatorname{Var}(I_t) \\[0.4em] &\quad + 2\sum_{s < t} \operatorname{Cov}(I_s, I_t), \end{aligned}

and positively correlated exceptions spread the count more widely than the binomial law does. The count also discards the order of the exceptions, so a count near np0n p_0 says nothing about their timing, and a surprising count does not identify the cause of the miscalibration.

In plain words Under the ideal null, counting exceptions is counting heads in nn tosses of a coin that lands heads with probability p0p_0. The count can be checked against the binomial law exactly, with no large-sample approximation, but it cannot tell whether the exceptions were spread out or bunched together.

Example In the constructed record of n=100n = 100 days at α=0.95\alpha = 0.95, the null gives p0=0.05p_0 = 0.05, E[K]=5\mathbb{E}[K] = 5 and Var⁡(K)=4.75\operatorname{Var}(K) = 4.75, a standard deviation of about 2.17942.1794. The observed k=12k = 12 has the exact upper tail P(K≥12)≈0.004274\mathbb{P}(K \ge 12) \approx 0.004274. For a one-sided test at level 0.050.05, the tails P(K≥9)≈0.0631\mathbb{P}(K \ge 9) \approx 0.0631 and P(K≥10)≈0.0282\mathbb{P}(K \ge 10) \approx 0.0282 show that the test rejects exactly when K≥10K \ge 10, so its actual size is about 0.02820.0282. The count 1212 lies well inside the rejection region.

Unconditional coverage test

Definition The unconditional coverage test compares the null hypothesis that I1,…,InI_1, \dots, I_n are independent Bernoulli variables with the stated parameter p0p_0 against the alternative that they are independent Bernoulli variables with an unrestricted parameter p∈[0,1]p \in [0, 1]. For an observed sequence with kk exceptions, the likelihood and the log-likelihood, with log the natural logarithm here and below, are

L(p)=pk(1−p)n−k,ℓ(p)=klog⁡p+(n−k)log⁡(1−p).\begin{aligned} \mathcal{L}(p) &= p^{k}(1 - p)^{n - k}, \\[0.4em] \ell(p) &= k\log p \\[0.4em] &+ (n - k)\log(1 - p). \end{aligned}

For 0<k<n0 < k < n the derivative

ℓ′(p)=kp−n−k1−p\ell'(p) = \frac{k}{p} - \frac{n - k}{1 - p}

vanishes only at p^=k/n\hat p = k/n, and ℓ′′(p)=−k/p2−(n−k)/(1−p)2<0\ell''(p) = -k/p^2 - (n - k)/(1 - p)^2 < 0, so p^\hat p is the unique maximizer. For k=0k = 0 or k=nk = n the likelihood is monotone in pp and is again largest at p^=k/n\hat p = k/n. The likelihood ratio statistic is

LR⁡uc=2[ℓ(p^)−ℓ(p0)]=2klog⁡p^p0+2(n−k)log⁡1−p^1−p0,\begin{aligned} \operatorname{LR}_{\text{uc}} &= 2\bigl[\ell(\hat p) - \ell(p_0)\bigr] \\[0.4em] &= 2k\log\frac{\hat p}{p_0} \\[0.4em] &\quad + 2(n - k)\log\frac{1 - \hat p}{1 - p_0}, \end{aligned}

where a term of the form 0log⁡00 \log 0 at k=0k = 0 or k=nk = n is read as its limit 00. The binomial coefficient is the same under both hypotheses and cancels. The statistic is nonnegative, and it is 00 only when k=np0k = n p_0. As a standard asymptotic result, under the null with a fixed p0∈(0,1)p_0 \in (0, 1) the statistic converges in distribution to χ12\chi^2_1 as n→∞n \to \infty, so rejecting when LR⁡uc>3.8415\operatorname{LR}_{\text{uc}} > 3.8415, the 0.950.95 quantile of χ12\chi^2_1, gives a test whose size tends to 0.050.05. The test is two-sided, so it rejects too few exceptions as well as too many. With a small expected count np0n p_0, or with p^\hat p on the boundary, exact binomial probabilities are more reliable than the χ12\chi^2_1 reference.

In plain words The statistic measures how much better the observed exception rate explains the record than the promised rate does. A large value says that the promised rate fits badly, whether the exceptions were too frequent or too rare.

Example In the constructed record, p^=12/100=0.12\hat p = 12/100 = 0.12, so p^/p0=2.4\hat p/p_0 = 2.4 and

LR⁡uc=24log⁡2.4+176log⁡0.880.95≈21.0112−13.4711≈7.5402.\begin{aligned} \operatorname{LR}_{\text{uc}} &= 24\log 2.4 \\[0.4em] &\quad + 176\log\frac{0.88}{0.95} \\[0.4em] &\approx 21.0112 - 13.4711 \\[0.4em] &\approx 7.5402 . \end{aligned}

It exceeds 3.84153.8415, and the asymptotic p-value P(χ12>7.5402)\mathbb{P}(\chi^2_1 > 7.5402) is about 0.00600.0060, while the exact one-sided upper tail is about 0.00430.0043. The approximation also shows in the size of the test. At n=100n = 100 the rule LR⁡uc>3.8415\operatorname{LR}_{\text{uc}} > 3.8415 rejects exactly when k≤1k \le 1 or k≥10k \ge 10, and under the null these counts have probability about 0.06530.0653, not 0.050.05.

Independence test

Definition For t=2,…,nt = 2, \dots, n, the transition count nijn_{ij} is the number of periods with It−1=iI_{t-1} = i and It=jI_t = j, for i,j∈{0,1}i, j \in \{0, 1\}, so that n00+n01+n10+n11=n−1n_{00} + n_{01} + n_{10} + n_{11} = n - 1. The first-order Markov alternative lets the exception probability depend on the previous indicator through p01=P(It=1∣It−1=0)p_{01} = \mathbb{P}(I_t = 1 \mid I_{t-1} = 0) and p11=P(It=1∣It−1=1)p_{11} = \mathbb{P}(I_t = 1 \mid I_{t-1} = 1). Conditional on the first indicator I1I_1, the likelihood of the observed sequence is

LM(p01,p11)=(1−p01)n00 p01n01×(1−p11)n10 p11n11,\begin{aligned} &\mathcal{L}_{M}(p_{01}, p_{11}) \\[0.4em] &= (1 - p_{01})^{n_{00}}\, p_{01}^{n_{01}} \\[0.4em] &\quad \times (1 - p_{11})^{n_{10}}\, p_{11}^{n_{11}}, \end{aligned}

and its two factors are maximized separately at

p^01=n01n00+n01,p^11=n11n10+n11.\begin{gathered} \hat p_{01} = \frac{n_{01}}{n_{00} + n_{01}}, \\[0.4em] \hat p_{11} = \frac{n_{11}}{n_{10} + n_{11}}. \end{gathered}

Independence means p01=p11=πp_{01} = p_{11} = \pi. With m=n−1m = n - 1 and k′=n01+n11k' = n_{01} + n_{11} the likelihood becomes πk′(1−π)m−k′\pi^{k'}(1 - \pi)^{m - k'}, which is maximized at π^=k′/m\hat\pi = k'/m. Writing ℓ^M\hat\ell_M and ℓ^iid\hat\ell_{\text{iid}} for the two maximized log-likelihoods, with 0log⁡0=00 \log 0 = 0, the independence statistic is

LR⁡ind=2(ℓ^M−ℓ^iid)≥0.\operatorname{LR}_{\text{ind}} = 2\bigl(\hat\ell_M - \hat\ell_{\text{iid}}\bigr) \ge 0 .

If no transition starts from one of the two states, for example when no exception occurs before period nn, that factor of the likelihood is constant, its estimate is undefined, and the statistic is 00. As a standard asymptotic result, under independent Bernoulli indicators with a fixed parameter in (0,1)(0, 1), the statistic converges in distribution to χ12\chi^2_1 as n→∞n \to \infty. In a finite sample this reference needs all four transition counts to be reasonably large. The alternative is first-order dependence only, so the test cannot be expected to detect dependence that leaves the two adjacent transition probabilities equal.

In plain words The test asks whether an exception makes another exception in the next period more likely, or less likely. It compares the exception rate right after an exception with the rate right after a quiet period.

Example Two constructed 20-period records each have four exceptions. In the spaced record they fall in periods 5, 10, 15 and 20, so n00=12n_{00} = 12, n01=4n_{01} = 4, n10=3n_{10} = 3 and n11=0n_{11} = 0. Hence p^01=4/16=0.25\hat p_{01} = 4/16 = 0.25 and p^11=0/3=0\hat p_{11} = 0/3 = 0, and the exception in period 20 starts no transition because the sample ends there. In the clustered record they fall in periods 9, 10, 11 and 12, so n00=14n_{00} = 14, n01=1n_{01} = 1, n10=1n_{10} = 1 and n11=3n_{11} = 3, with p^01=1/15≈0.0667\hat p_{01} = 1/15 \approx 0.0667 and p^11=3/4\hat p_{11} = 3/4. Both records have π^=4/19\hat\pi = 4/19. The statistic is about 1.56211.5621 for the spaced record and 7.71027.7102 for the clustered one. With only three or four transitions out of an exception the χ12\chi^2_1 reference is rough, but an exact check is available. Under independent Bernoulli indicators with any common parameter, all (204)=4845\binom{20}{4} = 4845 placements of four exceptions are equally likely given K=4K = 4. Exactly 1717 of them, the runs of four consecutive periods, give a statistic of 7.71027.7102 or more, a conditional probability of 17/4845≈0.003517/4845 \approx 0.0035.

Conditional coverage test

Definition The conditional coverage test takes as its null hypothesis p01=p11=p0p_{01} = p_{11} = p_0, which is independence together with the stated rate, against the first-order Markov alternative. With the same conditioning on I1I_1, the null likelihood of the m=n−1m = n - 1 transitions is

L0=p0k′(1−p0)m−k′,\mathcal{L}_0 = p_0^{k'}(1 - p_0)^{m - k'},

and the statistic is LR⁡cc=2(ℓ^M−ℓ0)\operatorname{LR}_{\text{cc}} = 2(\hat\ell_M - \ell_0) with ℓ0=log⁡L0\ell_0 = \log\mathcal{L}_0. Inserting the maximized independent log-likelihood between the two terms gives the exact identity

LR⁡cc=2(ℓ^M−ℓ^iid)+2(ℓ^iid−ℓ0)=LR⁡ind+LR⁡uc(m),\begin{aligned} \operatorname{LR}_{\text{cc}} &= 2\bigl(\hat\ell_M - \hat\ell_{\text{iid}}\bigr) \\[0.4em] &\quad + 2\bigl(\hat\ell_{\text{iid}} - \ell_0\bigr) \\[0.4em] &= \operatorname{LR}_{\text{ind}} + \operatorname{LR}_{\text{uc}}^{(m)}, \end{aligned}

where LR⁡uc(m)\operatorname{LR}_{\text{uc}}^{(m)} is the unconditional coverage statistic computed from the mm indicators I2,…,InI_2, \dots, I_n, which contain k′k' exceptions. The coverage statistic computed from all nn indicators uses different data and in general does not satisfy this identity. As a standard asymptotic result, under the null the statistic converges in distribution to χ22\chi^2_2, whose 0.950.95 quantile is 5.99155.9915, and the same caution about sparse transition counts applies. A first-order Markov alternative is also narrower than the full hypothesis of correct coverage given all of Ft−1\mathcal{F}_{t-1}, so a nonrejection does not confirm that hypothesis.

In plain words Conditional coverage asks two things at once, that exceptions occur at the promised rate and that this rate does not change after an exception. The statistic splits into one part for each question, provided both parts are computed from the same observations.

Example In both 20-period records, k′=4k' = 4 of the m=19m = 19 transitions end in an exception, so

LR⁡uc(19)=8log⁡4/190.05+30log⁡15/190.95≈5.9478.\begin{aligned} \operatorname{LR}_{\text{uc}}^{(19)} &= 8\log\frac{4/19}{0.05} \\[0.4em] &\quad + 30\log\frac{15/19}{0.95} \\[0.4em] &\approx 5.9478 . \end{aligned}

The clustered record has LR⁡cc≈7.7102+5.9478=13.6581\operatorname{LR}_{\text{cc}} \approx 7.7102 + 5.9478 = 13.6581 and the spaced record has LR⁡cc≈1.5621+5.9478=7.5099\operatorname{LR}_{\text{cc}} \approx 1.5621 + 5.9478 = 7.5099. Both exceed 5.99155.9915, mainly because four exceptions are far more than the one expected in 20 periods at p0=0.05p_0 = 0.05, and the clustered record also has a large independence part. The coverage statistic of the full sample, four exceptions in 20 periods, is about 5.59115.5911, and adding it to the clustered LR⁡ind\operatorname{LR}_{\text{ind}} gives 13.301413.3014, not LR⁡cc\operatorname{LR}_{\text{cc}}. Records this short illustrate the decomposition but are too sparse to support firm conclusions from the χ2\chi^2 references.

Check yourself

  1. A one-day 99 percent VaR is backtested over 250 days and has 6 exceptions. Under the null of independent exceptions with probability 0.010.01, find the mean and the standard deviation of the count and the probability of 6 or more exceptions. What do the exact one-sided test and the unconditional coverage test say at level 0.050.05?
Show the answer

The count is Binomial⁡(250,0.01)\operatorname{Binomial}(250, 0.01), so its mean is 250⋅0.01=2.5250 \cdot 0.01 = 2.5 and its variance is 2.5⋅0.99=2.4752.5 \cdot 0.99 = 2.475, a standard deviation of about 1.57321.5732. The probabilities of 00 to 55 exceptions are about 0.08110.0811, 0.20470.2047, 0.25740.2574, 0.21490.2149, 0.13410.1341 and 0.06660.0666, which add to about 0.95880.9588, so

P(K≥6)=1−∑j=05P(K=j)≈0.0412.\begin{aligned} &\mathbb{P}(K \ge 6) \\[0.4em] &= 1 - \sum_{j=0}^{5} \mathbb{P}(K = j) \\[0.4em] &\approx 0.0412 . \end{aligned}

This is below 0.050.05, so the exact one-sided test rejects. The estimate is p^=6/250=0.024\hat p = 6/250 = 0.024, and

LR⁡uc=12log⁡2.4+488log⁡0.9760.99≈10.5056−6.9503≈3.5554,\begin{aligned} \operatorname{LR}_{\text{uc}} &= 12\log 2.4 \\[0.4em] &\quad + 488\log\frac{0.976}{0.99} \\[0.4em] &\approx 10.5056 - 6.9503 \\[0.4em] &\approx 3.5554, \end{aligned}

which is below 3.84153.8415, with asymptotic p-value about 0.0590.059, so the unconditional coverage test does not reject at level 0.050.05. The two results do not contradict each other. The first is an exact one-sided test for too many exceptions, the second is a two-sided test judged against an asymptotic reference, and with an expected count of only 2.52.5 that reference is a rough guide.

  1. A 95 percent VaR model has no exceptions in 100 days, and a colleague calls this the best possible backtest result. Compute the unconditional coverage statistic and the exact probability of zero exceptions under the null, say whether the colleague is right, and explain how the assessment changes if the loss law has an atom at the forecast.
Show the answer

With k=0k = 0 the estimate is p^=0\hat p = 0, the first term of the statistic is 00 by the convention 0log⁡0=00 \log 0 = 0, and

LR⁡uc=200log⁡10.95≈10.2587,\begin{aligned} \operatorname{LR}_{\text{uc}} &= 200\log\frac{1}{0.95} \\[0.4em] &\approx 10.2587, \end{aligned}

well above 3.84153.8415, with asymptotic p-value about 0.00140.0014. Because p^\hat p is on the boundary, the exact probability is the better guide, and under the null P(K=0)=0.95100≈0.0059\mathbb{P}(K = 0) = 0.95^{100} \approx 0.0059. Both say that zero exceptions are unlikely for a correctly calibrated forecast. The record is evidence that exceptions occur less often than 5 percent of the time, which means the VaR forecasts are too high, so the colleague is wrong. An atom at the forecast changes the benchmark. For the loan position of the exception indicator card, a correct VaR of 00 has exception probability 0.030.03, not 0.050.05, and zero exceptions in 100 periods then has probability 0.97100≈0.04760.97^{100} \approx 0.0476. That is about eight times the probability under the rate 0.050.05, so against the correct rate the record is much weaker evidence against the forecasts.

  1. A 95 percent VaR record of 21 days has exceptions in periods 4, 5, 13 and 14. Find the transition counts and the estimates p^01\hat p_{01}, p^11\hat p_{11} and π^\hat\pi, and compute LR⁡ind\operatorname{LR}_{\text{ind}}, the coverage part on the 20 transitions and LR⁡cc\operatorname{LR}_{\text{cc}}. Does adding the full-sample coverage statistic to LR⁡ind\operatorname{LR}_{\text{ind}} give LR⁡cc\operatorname{LR}_{\text{cc}}?
Show the answer

The 20 transitions are n00=14n_{00} = 14, n01=2n_{01} = 2, n10=2n_{10} = 2 and n11=2n_{11} = 2, so p^01=2/16=0.125\hat p_{01} = 2/16 = 0.125, p^11=2/4=0.5\hat p_{11} = 2/4 = 0.5 and π^=4/20=0.2\hat\pi = 4/20 = 0.2. The three log-likelihoods are

ℓ^M=14log⁡0.875+2log⁡0.125+4log⁡0.5≈−8.8009,ℓ^iid=16log⁡0.8+4log⁡0.2≈−10.0080,ℓ0=16log⁡0.95+4log⁡0.05≈−12.8036.\begin{aligned} \hat\ell_M &= 14\log 0.875 + 2\log 0.125 \\[0.4em] &\quad + 4\log 0.5 \approx -8.8009, \\[0.4em] \hat\ell_{\text{iid}} &= 16\log 0.8 + 4\log 0.2 \\[0.4em] &\approx -10.0080, \\[0.4em] \ell_0 &= 16\log 0.95 + 4\log 0.05 \\[0.4em] &\approx -12.8036 . \end{aligned}

Hence LR⁡ind≈2.4143\operatorname{LR}_{\text{ind}} \approx 2.4143, the coverage part is LR⁡uc(20)≈5.5911\operatorname{LR}_{\text{uc}}^{(20)} \approx 5.5911, and LR⁡cc≈8.0054\operatorname{LR}_{\text{cc}} \approx 8.0054, their sum. The full-sample coverage statistic uses all 21 indicators with k=4k = 4 and is about 5.25955.2595, so adding it to LR⁡ind\operatorname{LR}_{\text{ind}} gives about 7.67387.6738, not LR⁡cc\operatorname{LR}_{\text{cc}}. Against the asymptotic references, LR⁡ind<3.8415\operatorname{LR}_{\text{ind}} < 3.8415 does not reject independence, while LR⁡cc>5.9915\operatorname{LR}_{\text{cc}} > 5.9915 rejects conditional coverage, with asymptotic p-value about 0.0180.018, mainly because of the count. Only four transitions start from an exception, so the independence reference is rough. Given K=4K = 4, an exact check counts 477477 of the 59855985 equally likely placements, about 8 percent, with an independence statistic of at least 2.41432.4143.

How this lesson connects

It also uses chi-squared distribution.