An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20111031/d5db5507/attachment.pl>
rugarch: solnp vs nlminb default control parameters
2 messages · Bob, Alexios Ghalanos
Hi Bob, Thanks for your feedback. This is definitely related to the handling (and scaling) of external regressor in variance and their constraint bounds when using the solnp solver. The following works: # 1. Avoid the external regressors: s2.spec <- ugarchspec(variance.model = list(model = "sGARCH", garchOrder =c(1,1)), mean.model = list(armaOrder = c(0,0), include.mean = FALSE)) fit3 = ugarchfit(s2.spec, dat, fit.control = list(scale=1)) # 2. Keep External Regressor and increase the tolerance fit2 <- ugarchfit(s.spec, data = dat, solver = "solnp", solver.control = list(trace = TRUE, tol=1e-12, delta=1e-11)) In a future release I might allow user adjustment of the bounds since the external regressors in both mean and variance equations do sometimes cause some problems. HTH. Best, Alexios
On 31/10/2011 18:33, Robert Harlow wrote:
Hi,
First off, this is a fantastic package, so very well done Alexios. I
am going to use the external regressor option in the rugarch package. In
order to do double check that everything is working properly, I decided to
fit a standard garch(0,1) where i use the lag of the residual as my
external regressor (this is the same as fitting a garch(1,1) model) rather
than explicitly expressing the order in ugarchspec. As the following code
shows, there are different results depending on whether you use solnp or
nlminb as the solver. I suspect this has to do with the default control
parameters set for solnp, as it appears solnp gets stuck near the starting
parameters. I don't think I have enough expertise to recommend different
default starting parameters for the solnp solver option, but it is an
interesting issue nonetheless.
Below is some sample code for the sp500ret dataset.
Thanks,
-Bob
library(rugarch)
data(sp500ret)
dat<- as.numeric(sp500ret[,1])
dat<- dat - mean(dat)
vx<- c(NA, dat[-length(dat)]^2)
dat<- dat[-1]
vx<- vx[-1]
s.spec<- ugarchspec(variance.model = list(model = "sGARCH", garchOrder =
c(0,1), external.regressors = as.matrix(vx)), mean.model = list(armaOrder =
c(0,0), include.mean = FALSE))
fit1<- ugarchfit(s.spec, data = dat, solver = "nlminb", solver.control =
list(trace = TRUE))
fit2<- ugarchfit(s.spec, data = dat, solver = "solnp", solver.control =
list(trace = TRUE))
par(mfrow = c(2,1))
plot(as.ts(sigma(fit1)))
plot(as.ts(sigma(fit2)))
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. If you want to post, subscribe first. -- Also note that this is not the r-help list where general R questions should go.