trftest.RdThe Traffic Light Test, is applied to previously calculated Value-at-Risk series.
trftest(obj)A list returned by the rollcast function, that contains
a Value-at-Risk series; any other list that follows the name conventions
of the rollcast function can be used as well.
A list of class quarks is returned with the following elements.
selected model for estimation
selected method for estimation
cumulative probability of observing the number of
breaches or fewer for (1 - p)100%-VaR
number of exceedances for (1 - p)100%-VaR
coverage level for (1-p)100% VaR
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.
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)
#>
#> Calculations completed.
trftest(results)
#>
#> --------------------------------------------
#> | Traffic Light Test |
#> --------------------------------------------
#> Method: Age Weighting
#> --------------------------------------------
#> | Traffic light zone boundaries |
#> --------------------------------------------
#> Zone Probability
#> Green zone: p < 95%
#> Yellow zone: 95% <= p < 99.99%
#> Red zone: p >= 99.99%
#> --------------------------------------------
#> | Test result - 97.5%-VaR |
#> --------------------------------------------
#> Number of violations: 4
#>
#> p = 0.2495: Green zone
#> --------------------------------------------