Learn R Programming

GAS (version 0.1.1)

BacktestVaR: Backtest Value at Risk (VaR)

Description

This function implements several backtesting procedure for the Value at Risk. These are: (i) The statistical tests of Kupiec (1995), Christoffesen (1998) and Engle and Manganelli (2004), (ii) The tick loss function detailed in Gonz\'alez-Rivera et al. (2004), the mean and max absolute loss used by McAleer and Da Veiga (2008) and the actual over expected exceedance ratio.

Usage

BacktestVaR(data, VaR, tau, alphaTest=0.95, Lags=4)

Arguments

data
numeric vector of observations.
VaR
numeric vector containing the Value at Risk series.
tau
numeric. The VaR confidence level.
alphaTest
numeric. Confidence level used in the statistical tests.
Lags
numeric. Lags used in the Dynamic Quantile test of Engle and Manganelli (2004).

Value

list with elements: LRuc, LRcc, DQ, AD, AE.

Details

This function implements several backtesting procedure for the Value at Risk. The implemented statistical tests are:
  • LRuc: The unconditional coverage test of Kupiec (1995).
  • LRcc: The conditional coverage test of Christoffesen (1998).
  • DQ: The Dynamic Quantile test of Engle and Manganelli (2004).

The implemented VaR backtesting quantities are:

  • AD: mean and maximum absolute deviation between the observations and the quantiles as in McAleer and Da Veiga (2008).
  • Loss: Average quantile loss and quantile loss series as in Gonz\'alez-Rivera et al. (2004).
  • AE: Actual over Expected exceedance ratio.

References

Christoffersen, P. F. (1998). Evaluating interval forecasts. International economic review, 841-862.

Engle, R. F., & Manganelli, S. (2004). CAViaR: Conditional autoregressive value at risk by regression quantiles. Journal of Business & Economic Statistics, 22(4), 367-381.

Gonz\'alez-Rivera, G., Lee, T. H., & Mishra, S. (2004). Forecasting volatility: A reality check based on option pricing, utility function, value-at-risk, and predictive likelihood. International Journal of forecasting, 20(4), 629-645.

Kupiec, P. H. (1995). Techniques for verifying the accuracy of risk measurement models. The J. of Derivatives, 3(2).

McAleer, M., & Da Veiga, B. (2008). Forecasting value-at-risk with a parsimonious portfolio spillover GARCH (PS-GARCH) model. Journal of Forecasting, 27(1), 1-19.

Examples

Run this code

data("StockIndices")

GASSpec = UniGASSpec(Dist = "std", ScalingType = "Identity",
                     GASPar = list(location = FALSE, scale = TRUE,
                                   shape = FALSE))

FTSEMIB = StockIndices[, "FTSEMIB"]

InSampleData  = FTSEMIB[1:1500]
OutSampleData = FTSEMIB[1501:2404]

Fit = UniGASFit(GASSpec, InSampleData)

Forecast = UniGASFor(Fit, Roll = TRUE, out = OutSampleData)

tau = 0.05

VaR = quantile(Forecast, tau)

BackTest = BacktestVaR(OutSampleData, VaR, tau)

Run the code above in your browser using DataLab