arch.univariate.christoffersen_independence

arch.univariate.christoffersen_independence(returns: ndarray[tuple[int], dtype[float64]] | Series | list[float], var: ndarray[tuple[int], dtype[float64]] | Series | list[float]) → WaldTestStatistic[source]

Christoffersen test of the independence of the exceptions of VaR.

Parameters:
returns: ndarray[tuple[int], dtype[float64]] | Series | list[float]

Realized returns, a 1-d array of finite numbers with at least 2 observations.

var: ndarray[tuple[int], dtype[float64]] | Series | list[float]

VaR forecasts as positive losses, a 1-d array of finite numbers. See var_exceptions for the sign convention and for how the inputs are aligned.

Returns:

The likelihood-ratio statistic, which is asymptotically \(\chi^2_1\) under the null that exceptions are independent, with its p-value.

Return type:

arch.utility.testing.WaldTestStatistic

Raises:
  • TypeError – If returns or var cannot be converted to numbers.

  • ValueError – If returns or var is not valid, as in var_exceptions, or there are fewer than 2 observations.

See also

kupiec_pof

Test of the proportion of exceptions.

christoffersen_conditional_coverage

Joint test of coverage and independence.

Notes

The null is that the probability of an exception does not depend on whether the previous day was an exception, against a first-order Markov chain. With \(n_{ij}\) the number of days in state \(j\) that follow a day in state \(i\) (1 is an exception), \(\hat{\pi}_{i}=n_{i1}/(n_{i0}+n_{i1})\) and \(\hat{\pi}=(n_{01}+n_{11})/\sum n_{ij}\), the statistic of Christoffersen (1998) [1] is

\[LR_{ind} = -2\ln\left[\frac{(1-\hat{\pi})^{n_{00}+n_{10}} \hat{\pi}^{n_{01}+n_{11}}} {(1-\hat{\pi}_0)^{n_{00}}\hat{\pi}_0^{n_{01}} (1-\hat{\pi}_1)^{n_{10}}\hat{\pi}_1^{n_{11}}}\right].\]

The first observation is conditioned on, so the \(T-1\) transitions are used. A term \(0\ln 0\) is 0. If no day follows a state, for example when there is no exception before the last day, \(\hat{\pi}_i\) is not defined and does not enter the statistic. The statistic is 0 for a series with no exceptions or only exceptions. A probability that is 0, because no exception follows an exception (\(n_{11}=0\)), is evaluated at the limit.

References