cvgtest {quarks} | R Documentation |
Unconditional and Conditional Coverage Tests, Independence Test
Description
The conditional (Kupiec, 1995), the unconditional coverage test (Christoffersen, 1998) and the independence test (Christoffersen, 1998) of the Value-at-Risk (VaR) are applied.
Usage
cvgtest(obj = list(loss = NULL, VaR = NULL, p = NULL), conflvl = 0.95)
Arguments
obj |
a list that contains the following elements:
|
conflvl |
a numeric vector with one element; the significance
level at which the null hypotheses are evaluated; is set to |
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 with
observations, divide the
series into
in-sample and
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
if or
otherwise,
for as the hit sequence, where
is
the confidence level for the VaR (often
or
).
Furthermore, denote
and let
be the actual covered
proportion of losses in the data.
1. Unconditional coverage test:
Let be the number of ones in
and analogously
the number of
zeros (all conditional on the first observation).
Also calculate
. Obtain
and
and subsequently the test statistic
now asymptotically follows a chi-square-distribution with one degree
of freedom.
2. Conditional coverage test:
The conditional coverage test combines the unconditional coverage test
with a test on independence. Denote by the probability of an
on day
being followed by a
on day
, where
and
correspond to the value of
on the respective day.
with and
.
Let be the number of observations, where the values on two following days
follow the pattern
. Calculate
where and
. The test
statistic is then given by
which asymptotically follows a chi-square-distribution with two degrees of freedom.
3. Independence test:
The asymptotically chi-square-distributed test statistic (one degree of freedom) is given by
—————————————————————————–
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.
Value
A list of class quarks
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
- model
selected model for estimation; only available if a list returned by the
rollcast
function is passed tocvgtest
- method
selected method for estimation; only available if a list returned by the
rollcast
) function is passed tocvgtest
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).
Examples
prices <- DAX$price_close
returns <- diff(log(prices))
n <- length(returns)
nout <- 250 # number of obs. for out-of-sample forecasting
nwin <- 500 # window size for rolling forecasts
results <- rollcast(x = returns, p = 0.975, method = 'age', nout = nout,
nwin = nwin)
cvgtest(results)