Usage: |
VaR = VaRest(y{,method}{,opt})
|
Input: |
| y | n x d matrix, the returns of d assets.
|
| method | method for VaR, one of
"RMA" (rectangular moving average),
"EMA" (exponential moving average),
"MAD" (mean absolute deviation),
"EDF" (empirical distribution function).
The default method is "RMA".
|
| opt | optional, a list with optional input. The function
"VaRopt" can be used to set up this parameter.
The order of the list elements is not important.
|
| opt.h | positive integer, window width.
If not given, set to 250.
|
| opt.lam | positive scalar, parameter for EMA method.
If not given, set to 0.96.
|
| opt.dist | integer, distribution. The default is 0 for
normal, a positive integer denotes the degrees
of freedom when using a t-distribution.
|
| opt.alpha | scalar in (0,1), significance level. The
default is 0.01.
|
| opt.w | scalar, 1 x d or n x d, weights for assets.
If not given, set to 1.
|
| opt.bw | scalar, bandwidth for method "KDQ" for
quantiles from a kernel density estimator.
If not given, chosen by Silverman's rule
of thumb.
|
Output: |
| VaR | (n-h) x 2 vector, the VaR for observations
h+1 to n. |