BacktestVaR: Backtest Value at Risk (VaR)

Description Usage Arguments Details Value Author(s) References Examples

View source: R/BackTest.R

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

1
BacktestVaR(data, VaR, alpha, Lags = 4)

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).

Details

This function implements several backtesting procedure for the Value at Risk. The implemented statistical tests are:

The implemented VaR backtesting quantities are:

Value

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

Author(s)

Leopoldo Catania

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. 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. 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. 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. doi: 10.1002/for.1049.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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)

LeopoldoCatania/GAS documentation built on April 27, 2020, 1:43 a.m.