CAViaR_optim: Optimize a model

Description Usage Arguments Value Author(s) References Examples

Description

Finds optimal parameters for one of the following quantile regression models:
Symmetric Absolute Value: f_t(b) = b1 + b2 f_t-1(b) + b3 |y_t-1|
Asymmetric Slope: f_t(b) = b1 + b2 f_t-1(b) + b3 (y_t-1)[+] + b4 (y_t-1)[-]
Indirect GARCH(1,1): f_t(b) = (b1 + b2 f_t-1(b)^2 + b3 y_t-1^2)^0.5
Adaptive: f_t(b1) = f_t-1(b1) + b1 [1-exp(G[y_t-1 - f_t-1(b1)])]^-1 - prob

f(b) is the quantile for probability level (prob) given b1,b2,...
(x)[+] = max(x,0)
(x)[-] = min(x,0)

Usage

1
CAViaR_optim <- function(y, Model=1, prob=0.05)

Arguments

y

A numeric array with values intended for estimating the model.

Model

Scalar between 1 and 5. 1 = Symmetric Absolute Value, 2 = Asymmetric Slope
3 = Indirect GARCH(1,1), 4 = Adaptive, 5 = Symmetric Absolute Value with b2 set to zero.

prob

Scalar between 0 and 1 gives the quantile.

Value

Returns a list with 4 elements:
$bestRQ: The score used to optimize the model parameter.
$bestVals: The ten best parameter vectors and their corresponding RQ score.
$bestPar: The optimal parameter vector.
$VAR: In sample Value at Risk (or quantile values) given the optimal parameter vector.

Author(s)

Steinar Veka

References

Robert F. Engle and Simone Manganelli CAViaR: Conditional Autoregressive Value at Risk by Regression Quantiles Journal of Business & Economic Statistics Vol. 22, No. 4 (Oct., 2004), pp. 367-381 Published by: American Statistical Association Article Stable URL: http://www.jstor.org/stable/1392044

Examples

1
2
3
4
5
6
dax <- c(EuStockMarkets[,2]) 
r_dax <- diff(log(dax)) 
fit = CAViaR_optim(r_dax, Model=1, prob=0.05) 
mean(r_dax<fit$VAR) 
plot(r_dax, type="l", ylim=range(r_dax)*1.2) 
lines(fit$VAR, col=3) 

steinarv/quantileVaR documentation built on May 30, 2019, 10:46 a.m.