VaRTest {rugarch} | R Documentation |
Implements the unconditional and conditional coverage Value at Risk Exceedances Test.
VaRTest(alpha = 0.05, actual, VaR, conf.level = 0.95)
alpha |
The quantile (coverage) used for the VaR. |
actual |
A numeric vector of the actual (realized) values. |
VaR |
The numeric vector of VaR. |
conf.level |
The confidence level at which the Null Hypothesis is evaluated. |
The test implements both the unconditional (Kupiec) and conditional(Christoffersen) coverage tests for the correct number of exceedances. See the references for further details.
A list with the following items:
expected.exceed |
The expected number of exceedances (length actual x coverage). |
actual.exceed |
The actual number of exceedances. |
uc.H0 |
The unconditional coverage test Null Hypothesis. |
uc.LRstat |
The unconditional coverage test Likelihood Ratio statistic. |
uc.critical |
The unconditional coverage test critical value. |
uc.LRp |
The unconditional coverage test p-value. |
uc.H0 |
The unconditional coverage test Null Hypothesis. |
uc.Decision |
The unconditional coverage test Decision on H0 given the confidence level. |
cc.H0 |
The conditional coverage test Null Hypothesis. |
cc.LRstat |
The conditional coverage test Likelihood Ratio statistic. |
cc.critical |
The conditional coverage test critical value. |
cc.LRp |
The conditional coverage test p-value. |
cc.H0 |
The conditional coverage test Null Hypothesis. |
cc.Decision |
The conditional coverage test Decision on H0 given the confidence level. |
Alexios Ghalanos
Christoffersen, P. (1998), Evaluating Interval Forecasts,
International Economic Review, 39, 841–862.
Christoffersen, P., Hahn,J. and Inoue, A. (2001), Testing and Comparing
Value-at-Risk Measures, Journal of Empirical Finance, 8, 325–342.
## Not run: data(dji30ret) spec = ugarchspec(mean.model = list(armaOrder = c(1,1), include.mean = TRUE), variance.model = list(model = "gjrGARCH"), distribution.model = "sstd") fit = ugarchfit(spec, data = dji30ret[1:1000, 1, drop = FALSE]) spec2 = spec setfixed(spec2)<-as.list(coef(fit)) filt = ugarchfilter(spec2, dji30ret[1001:2500, 1, drop = FALSE], n.old = 1000) actual = dji30ret[1001:2500,1] # location+scale invariance allows to use [mu + sigma*q(p,0,1,skew,shape)] VaR = fitted(filt) + sigma(filt)*qdist("sstd", p=0.05, mu = 0, sigma = 1, skew = coef(fit)["skew"], shape=coef(fit)["shape"]) print(VaRTest(0.05, actual, VaR)) ## End(Not run)