Provides a simple binomial backtest for a Value at Risk (VaR) model.
This function performs a Kupiec Proportion of Failures (POF) test to evaluate
whether the number of times returns breached the VaR threshold matches the expected
frequency 1-p.
The original implementation was provided in the archived VaR package by Talgat Daniyarov.
Value
A list containing:
expected_exceedancesthe expected number of VaR breaches.actual_exceedancesthe number of actual VaR breaches.p.valuethe p-value from the binomial proportion test.
References
Daniyarov, T. VaR: Value at Risk estimation. CRAN Archive. 2004. https://cran.r-project.org/src/contrib/Archive/VaR/
Examples
data(edhec)
# calculate VaR at 95 percent confidence
v <- as.numeric(VaR(edhec[, 1], p = 0.95, method = "historical"))
# evaluate the backtest
VaR.backtest(edhec[, 1], v, p = 0.95)
#> $expected_exceedances
#> [1] 14.65
#>
#> $actual_exceedances
#> [1] 15
#>
#> $p.value
#> [1] 1
#>