Unconditional and Conditional Coverage Tests, Independence Test
Unconditional and Conditional Coverage Tests, Independence Test
The conditional (Kupiec, 1995), the unconditional coverage test (Christoffersen, 1998) and the independence test (Christoffersen, 1998) of the Value-at-Risk (VaR) can be applied.
covtest(obj = list(Loss =NULL, VaR =NULL, p =NULL), conflvl =0.95)
Arguments
obj: a list that contains the following elements:
Loss: a numeric vector that contains the values of a loss series ordered from past to present; is set to NULL by default.
VaR: a numeric vector that contains the estimated values of the VaR for the same time points of the loss series Loss; is set to NULL by default.
p: a numeric vector with one element; defines the probability p stated in the null hypotheses of the coverage tests (see the section Details for more information); is set to NULL by default.
conflvl: a numeric vector with one element; the significance level at which the null hypotheses are evaluated; is set to 0.95 by default. Please note that a list returned by the varcast function can be directly passed to covtest.
Returns
A list of class ufRisk with the following four elements:
p: probability p stated in the null hypotheses of the coverage tests.
p.uc: the p-value of the unconditional coverage test.
p.cc: the p-value of the conditional coverage test.
p.ind: the p-value of the independence test.
conflvl: the significance level at which the null hypotheses are evaluated.
Details
With this function, the conditional and the unconditional coverage tests introduced by Kupiec (1995) and Christoffersen (1998) can be applied. Given a return series rt with n observations, divide the series into n−K in-sample and K out-of-sample observations, fit a model to the in-sample data and obtain rolling one-step forecasts of the VaR for the out-of-sample time points.
Define
It=1,
if −rt>VaRt(α) or
It=0,
otherwise,
for t=n+1,n+2,...,n+K as the hit sequence, where α is the confidence level for the VaR (often α=0.95 or α=0.99). Furthermore, denote p=α and let w be the actual covered proportion of losses in the data.
Unconditional coverage test:
H0,uc:p=w
Let K1 be the number of ones in It and analogously K0 the number of zeros (all conditional on the first observation). Also calculate w^=K0/(K−1). Obtain
L(It,p)=pK0(1−p)K1
and
L(It,w^)=w^K0(1−w^)K1
and subsequently the test statistic
LRuc=−2∗ln{L(It,p)/L(It,w^)}.
LRuc now asymptotically follows a chi-square-distribution with one degree of freedom.
Conditional coverage test:
The conditional coverage test combines the unconditional coverage test with a test on independence. Denote by wij the probability of an i on day t−1 being followed by a j on day t, where i and j correspond to the value of It on the respective day.
H0,cc:w00=w10=p
with i=0,1 and j=0,1.
Let Kij be the number of observations, where the values on two following days follow the pattern ij. Calculate
where w^00=K00/K0 and w^10=K10/K1. The test statistic is then given by
LRcc=−2∗ln{L(It,p)/L(It,w^00,w^10)},
which asymptotically follows a chi-square-distribution with two degrees of freedom.
Independence test:
H0,ind:w00=w10
The asymptotically chi-square-distributed test statistic (one degree of freedom) is given by
LRind=−2∗ln{L(It,w^00,w^10)/L(It,w^)}.
The function needs four inputs: the out-of-sample loss series obj$Loss, the corresponding estimated VaR series obj$VaR, the coverage level obj$p, for which the VaR has been calculated and the significance level conflvl, at which the null hypotheses are evaluated. If an object returned by this function is entered into the R console, a detailed overview of the test results is printed.
Examples
# Example for Walmart Inc. (WMT)prices <- WMT$price.close
output <- varcast(prices)Loss <--output$ret.out
VaR <- output$VaR.v
covtest.data <- list(Loss = Loss, VaR = VaR, p =0.99)covtest(covtest.data)# directly passing an output object of 'varcast()' to 'covtest()'output <- varcast(prices)covtest(output)
References
Christoffersen, P. F. (1998). Evaluating interval forecasts. International economic review, pp. 841-862.
Kupiec, P. (1995). Techniques for verifying the accuracy of risk measurement models. The J. of Derivatives, 3(2).
Author(s)
Sebastian Letmathe (Scientific Employee) (Department of Economics, Paderborn University)
Dominik Schulz (Scientific Employee) (Department of Economics, Paderborn University),