| trftest {quarks} | R Documentation |
Backtesting of Value-at-Risk via Traffic Light Test
Description
The Traffic Light Test, is applied to previously calculated Value-at-Risk series.
Usage
trftest(obj)
Arguments
obj |
A list returned by the |
Details
This function uses an object returned by the rollcast function
of the quarks package as an input for the
function argument obj. A list with different elements, such as
the cumulative probabilities for the VaR series within obj,
is returned. Instead of the list, only the traffic light backtesting results
are printed to the R console.
Value
A list of class quarks is returned with the following elements.
- model
selected model for estimation
- method
selected method for estimation
- p_VaR
cumulative probability of observing the number of breaches or fewer for (1 -
p)100%-VaR- pot_VaR
number of exceedances for (1 -
p)100%-VaR- p
coverage level for (1-
p)100% VaR
Examples
prices <- DAX$price_close
returns <- diff(log(prices))
n <- length(returns)
nout <- 250 # number of obs. for out-of-sample forecasting
nwin <- 500 # window size for rolling forecasts
results <- rollcast(x = returns, p = 0.975, method = 'age', nout = nout,
nwin = nwin)
trftest(results)