Description Usage Arguments Details Author(s) See Also Examples
Backtesting Value-at-Risk estimate over a moving window.
1 2 | backtestVaR(R, window = 100, p = 0.95, method = "historical",
bootstrap = FALSE, replications = 1000, bootParallel = FALSE)
|
R |
xts or zoo object of asset returns |
window |
size of the moving window in the rolling VaR estimate. |
p |
confidence level for the VaR estimate. |
method |
method for the VaR calculation. Valid choices are "modified", "guassian", "historical", and "kernel" |
bootstrap |
TRUE/FALSE use the bootstrap estimate for the VaR calculation, (default FALSE). |
replications |
number of bootstrap replications. |
bootParallel |
TRUE/FALSE run the bootstrap in parallel, (default FALSE). |
The size of the moving window is set with the window
argument. For
example, if the window size is 100, periods 1:100 are used to estimate the
VaR level for period 101.
Ross Bennett
1 2 3 4 5 6 7 | data(crsp_weekly)
R <- largecap_weekly[, 1]
backtest <- backtestVaR(R, window=100, p=0.95, method=c("gaussian", "historical", "modified"))
backtest
head(getVaREstimates(backtest))
head(getVaRViolations(backtest))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.