VaRSimTest | R Documentation |
Calculate VaR with three method and implement unconditional and conditional coverage test.
VaRSimTest(data, method, alpha, fun, ...)
data |
vector of returns |
method |
the VaR method, one of "param", "hist" and "mc" |
alpha |
the VaR confidence level |
fun |
function calculating VaR, limited by |
... |
the extra parameters of |
A list of VaR and coverage test outcome
Christoffersen P. F. 1998. "Evaluating Interval Forecasts", International Economic Review, 841-862. doi: 10.2307/2527341.
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.
swan <- rGarch(len = 30) date <- as.Date("2015-01-01") + days(0:(length(swan) - 1)) tswan <- tibble(garch = swan, date = date) tsswan <- as.xts(swan, date) alpha = 0.05 num = 100000 mu = mean(tsswan) sd = sd(tsswan) VaRSimTest(tsswan, "mc", alpha , rnorm, 100000, mu, sd)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.