Learn R Programming

GAS (version 0.3.4.1)

BacktestVaR: Backtest Value at Risk (VaR)

Description

This function implements several backtesting procedures for the Value at Risk (VaR). These are: (i) The statistical tests of Kupiec (1995), Christoffesen (1998) and Engle and Manganelli (2004), (ii) The tick loss function detailed in Gonzalez-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, alpha, Lags = 4)

Value

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

Arguments

data

numeric Vector of observations.

VaR

numeric Vector containing the VaR series.

alpha

numeric The VaR confidence level.

Lags

numeric Lags used in the Dynamic Quantile test of Engle and Manganelli (2004).

Author

Leopoldo Catania

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 Gonzalez-Rivera et al. (2004).

  • AE Actual over Expected exceedance ratio.

References

Christoffersen PF (1998). "Evaluating Interval Rorecasts." International Economic Review, 39(4), 841-862.

Engle RF and Manganelli S. (2004). "CAViaR: Conditional Autoregressive Value at Risk by Regression Quantiles." Journal of Business & Economic Statistics, 22(4), 367-381. tools:::Rd_expr_doi("10.1198/073500104000000370").

Gonzalez-Rivera G, Lee TH, and 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. tools:::Rd_expr_doi("10.1016/j.ijforecast.2003.10.003").

Kupiec PH (1995). "Techniques for Verifying the Accuracy of Risk Measurement Models." The Journal of Derivatives, 3(2), 73-84. tools:::Rd_expr_doi("10.3905/jod.1995.407942")

McAleer M and Da Veiga B (2008). "Forecasting Value-at-Risk with a Parsimonious Portfolio Spillover GARCH (PS-GARCH) Model." Journal of Forecasting, 27(1), 1-19. tools:::Rd_expr_doi("10.1002/for.1049").

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)

alpha = 0.05

VaR = quantile(Forecast, alpha)

BackTest = BacktestVaR(OutSampleData, VaR, alpha)

Run the code above in your browser using DataLab