arch.univariate.kupiec_pof¶
-
arch.univariate.kupiec_pof(returns: ndarray[tuple[int], dtype[float64]] | Series | list[float], var: ndarray[tuple[int], dtype[float64]] | Series | list[float], p: float =
0.05) WaldTestStatistic[source]¶ Kupiec proportion-of-failures test of the coverage of VaR.
- Parameters:¶
- returns: ndarray[tuple[int], dtype[float64]] | Series | list[float]¶
Realized returns, a 1-d array of finite numbers.
- 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.
- p: float =
0.05¶ The probability of an exception that the VaR is designed for, which is the size of the tail, in the interval (0, 0.5]. It is 0.05 for a 95% VaR and 0.01 for a 99% VaR. The default is 0.05, a 95% VaR.
- Returns:¶
The likelihood-ratio statistic, which is asymptotically \(\chi^2_1\) under the null that the probability of an exception is
p, with its p-value.- Return type:¶
- Raises:¶
TypeError – If
returnsorvarcannot be converted to numbers, orpis not a real number.ValueError – If
returnsorvaris not valid, as in var_exceptions, orpis not in (0, 0.5].
See also
christoffersen_independenceTest of the independence of the exceptions.
christoffersen_conditional_coverageJoint test of coverage and independence.
traffic_lightThe Basel zone of the number of exceptions.
Notes
With \(x\) exceptions in \(T\) observations and \(\hat{\pi}=x/T\), the statistic of Kupiec (1995) [1] is
\[LR_{uc} = -2\ln\left[\frac{(1-p)^{T-x}p^x} {(1-\hat{\pi})^{T-x}\hat{\pi}^x}\right].\]The test is two-sided, so too few exceptions reject as well as too many. The terms \(0\ln 0\) of a series with no exception, or only exceptions, are 0, which is the limit of the likelihood, so that the statistic is \(-2T\ln(1-p)\) and \(-2T\ln p\).
References