# cci

Conditional coverage independence test for value-at-risk (VaR) backtesting

## Description

generates the conditional coverage independence (CCI) for value-at-risk (VaR)
backtesting.`TestResults`

= cci(`vbt`

)

adds an optional name-value pair argument for
`TestResults`

= cci(`vbt`

,`Name,Value`

)`TestLevel`

.

## Examples

## Input Arguments

## Output Arguments

## More About

## Algorithms

To define the likelihood ratio (test statistic) of the `cc`

test,
first define the following quantities:

`'N00'`

— Number of periods with no failures followed by a period with no failures`'N10'`

— Number of periods with failures followed by a period with no failures`'N01'`

— Number of periods with no failures followed by a period with failures`'N11'`

— Number of periods with failures followed by a period with failures

Then define the following conditional probability estimates:

*p*`01`

= Probability of having a failure on period*t*, given that there was no failure on period*t*-`1`

$$p01=\text{}\frac{\text{N01}}{(\text{N00+N01)}}\text{}$$

*p*`11`

= Probability of having a failure on period*t*, given that there was a failure on period*t*-`1`

$$p11=\text{}\frac{\text{N11}}{(\text{N10+N11)}}\text{}$$

Define also the unconditional probability estimate of observing a failure:

*pUC* = Probability of having a failure on period
*t*

$$pUC=\text{}\frac{\text{(N01+N11)}}{(\text{N00+N01+N10+N11)}}\text{}$$

The likelihood ratio of the CCI test is then given by

$$\begin{array}{l}LRatioCCI=-2\mathrm{log}\left(\frac{{\left(1-pUC\right)}^{N00+N10}pU{C}^{N01+N11}}{{\left(1-p01\right)}^{N00}p{01}_{}^{N01}{\left(1-p11\right)}^{N10}p{11}_{}^{N11}}\right)\\ =-2((\text{N00+N10)log(1}-pUC)+(\text{N01+N11)log(}pUC)-\text{N00log(1}-p01)-\text{N01log(}p01)-\text{N10log(1}-p11)-\text{N11log(}p11))\end{array}$$

which is asymptotically distributed as a chi-square distribution with 1 degree of freedom.

The *p*-value of the CCI test is the probability that a
chi-square distribution with 1 degree of freedom exceeds the likelihood ratio
`LRatioCCI`

,

$$PValueCCI=\text{1-}F(LRatioCCI)$$

where *F* is the cumulative distribution of a chi-square variable
with 1 degree of freedom.

The result of the test is to accept if

$$F(LRatioCCI)<F(TestLevel)$$

and reject otherwise, where *F* is the cumulative distribution of
a chi-square variable with 1 degree of freedom.

If one or more of the quantities `N00`

, `N10`

,
`N01`

, or `N11`

are zero, the likelihood ratio
is handled differently. The likelihood ratio as defined above is composed of three
likelihood functions of the form

$$L={(1-p)}^{n1}\times {p}^{n2}$$

For example, in the numerator of the likelihood ratio, there is a likelihood
function of the form *L* with *p* =
*pUC*, *n1* = `N00`

+
`N10`

, and *n2* = `N01`

+
`N11`

. There are two such likelihood functions in the
denominator of the likelihood ratio.

It can be shown that whenever *n1* = `0`

or
*n2* = `0`

, the likelihood function
*L* is replaced by the constant value `1`

.
Therefore, whenever `N00`

, `N10`

,
`N01`

, or `N11`

is zero, replace the
corresponding likelihood functions by `1`

in the likelihood ratio,
and the likelihood ratio is well-defined.

## References

[1] Christoffersen, P. "Evaluating Interval Forecasts."
*International Economic Review.* Vol. 39, 1998, pp. 841 –
862.

## Version History

**Introduced in R2016b**