[R-SIG-Finance] VaR calculation warning with rugarch

Mingersming minger00 at gmx.de
Sun Aug 16 18:55:20 CEST 2015


Hi all,

there is one issue I can´t go one myself. I try to fit a nig-distribution in
a rolling window method to a time-series with the fantastic rugarch package.
I use the option 'calculate.VaR' for several other distributions and it
works fine, but if I switch to the nig-distribution, I recieve the following
warning:

In ans[i] = mu[i] + sigma[i] * .qsnigC(p, rho = skew[i],  ... :number of
items to replace is not a multiple of replacement length

I tried to turn off the option and calculate the quantile on my own. I think
there is an misstake with the number of the parameters, but what can I
change to get over? 

For code, see below

Best regards 

library(quantmod)
library(rugarch)
library(PerformanceAnalytics)

bi <- getSymbols('^GDAXI', from = "2004-01-01", to = "2015-08-01")	
bi <- Ad(get(bi[1]))
bi_tlr <- Return.calculate(bi, method = "log")
bi_tlr <- na.omit(bi_tlr)

ctrl = list(rho = 1, delta = 1e-11, outer.iter = 1000, tol = 1e-12)
cl = makePSOCKcluster(10)

T = nrow(bi_tlr)
t_bt <- nrow(as.xts(bi_tlr)["2006-01-01/2015-08-01"]) 
t_est <- T - t_bt

spec_nig = ugarchspec(variance.model = list(model = "sGARCH", garchOrder =
c(1,1)), 
mean.model = list(armaOrder = c(0,0), include.mean = FALSE),
distribution.model = "nig")

bi.backtest.nig = ugarchroll(spec_nig, data = bi_tlr, n.ahead = 1,
forecast.length = 10, refit.every = 1, refit.window = "moving", solver =
"hybrid", fit.control = list(), solver.control = ctrl, calculate.VaR = TRUE,
VaR.alpha = c(0.01,0.05), cluster = cl,keep.coef = TRUE)





--
View this message in context: http://r.789695.n4.nabble.com/VaR-calculation-warning-with-rugarch-tp4711164.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list