backtestVaR: Backtest Value-at-Risk (VaR)

Description Usage Arguments Details Author(s) See Also Examples

Description

Backtesting Value-at-Risk estimate over a moving window.

Usage

1
2
backtestVaR(R, window = 100, p = 0.95, method = "historical",
  bootstrap = FALSE, replications = 1000, bootParallel = FALSE)

Arguments

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).

Details

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.

Author(s)

Ross Bennett

See Also

VaR, bootVaR

Examples

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))

GARPFRM documentation built on May 2, 2019, 5:45 p.m.

Related to backtestVaR in GARPFRM...