Learn R Programming

rugarch (version 1.0-16)

VaRTest: Value at Risk Exceedances Test

Description

Implements the unconditional and conditional coverage Value at Risk Exceedances Test.

Usage

VaRTest(alpha = 0.05, actual, VaR, conf.level = 0.95)

Arguments

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.

Value

  • A list with the following items:
  • expected.exceedThe expected number of exceedances (length actual x coverage).
  • actual.exceedThe actual number of exceedances.
  • uc.H0The unconditional coverage test Null Hypothesis.
  • uc.LRstatThe unconditional coverage test Likelihood Ratio statistic.
  • uc.criticalThe unconditional coverage test critical value.
  • uc.LRpThe unconditional coverage test p-value.
  • uc.H0The unconditional coverage test Null Hypothesis.
  • uc.DecisionThe unconditional coverage test Decision on H0 given the confidence level.
  • cc.H0The conditional coverage test Null Hypothesis.
  • cc.LRstatThe conditional coverage test Likelihood Ratio statistic.
  • cc.criticalThe conditional coverage test critical value.
  • cc.LRpThe conditional coverage test p-value.
  • cc.H0The conditional coverage test Null Hypothesis.
  • cc.DecisionThe conditional coverage test Decision on H0 given the confidence level.

Details

The test implements both the unconditional (Kupiec) and conditional(Christoffersen) coverage tests for the correct number of exceedances. See the references for further details.

References

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.

Examples

Run this code
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))

Run the code above in your browser using DataLab