[R-SIG-Finance] Rugarch package using external regressors
alexios galanos
alexios at 4dscape.com
Mon Aug 29 17:39:27 CEST 2016
Yes, you are missing good default bounds for the external regressors.
Try:
setbounds(aug.s.spec)<-list("vxreg1"=c(-1, 1))
This gives me the same results.
Alexios
On 29/08/2016 18:28, Luigi Maria Briglia wrote:
> I’m using the rugarch package and I’m having troubles understanding how the external.regressors work.
>
> For example I would expect that fitting a time series with gjr-garch(1,1) should give the same results as fitting the same time series with the plain vanilla garch(1,1) augmented with S_(t-1)*eps_(t-1)^2 as an external regressor.
>
> However I'm not getting the same results.
>
> Specifically this is the code I'm running:
>
> rm(list = ls()) # empty memory
>
> library(rugarch)
> library(xts)
> data(sp500ret)
> spx <- xts(sp500ret, as.Date(rownames(sp500ret)))
> t = length(spx)
> # assuming mu = 0; r_t = eps_t
> s = rep(0,t)
> for(i in 1:t){
> if(spx[i]<0){s[i]=1}
> }
> # eps.neg represents the leverage effect regressor
> eps.neg <- xts(spx*s, as.Date(rownames(sp500ret)))
> colnames(eps.neg)<-"eps.neg"
> # lag eps.neg
> eps.neg.lag = lag(eps.neg,1)
> inputs<-na.omit(cbind(spx, eps.neg.lag, join="left"))
> # gjrgarch(1,1)
> gjr.spec <- ugarchspec(variance.model = list(model='gjrGARCH', garchOrder=c(1,1),
> external.regressors = NULL, variance.targeting = T),
> mean.model = list(armaOrder=c(0,0)),fixed.pars=list(mu = 0))
> gjr.fit <- ugarchfit(spec=gjr.spec, data=inputs[,1],
> solver.control=list(trace = 1))
> # garch(1,1) augmented with inputs[,2]
> aug.s.spec <- ugarchspec(variance.model = list(model='sGARCH', garchOrder=c(1,1),
> external.regressors = inputs[,2]^2, variance.targeting = T),
> mean.model = list(armaOrder=c(0,0)),fixed.pars=list(mu = 0))
> aug.s.fit <- ugarchfit(spec=aug.s.spec, data=inputs[,1],
> solver.control=list(trace = 1))
> #results
> gjr.fit
> aug.s.fit
> However these are the results:
>
> GJR-GARCH(1,1)
>
> Robust Standard Errors:
> Estimate Std. Error t value Pr(>|t|)
> mu 0.000000 NA NA NA
> alpha1 0.007933 0.000184 43.139 0
> beta1 0.909048 0.000008 117316.512 0
> gamma1 0.139258 0.004006 34.764 0
> omega 0.000002 NA NA NA
> Augmented-Garch(1,1)
>
> Robust Standard Errors:
> Estimate Std. Error t value Pr(>|t|)
> mu 0.000000 NA NA NA
> alpha1 0.085378 0.002123 4.0223e+01 0.00000
> beta1 0.904696 0.000001 1.0116e+06 0.00000
> vxreg1 0.000000 0.000060 1.6700e-04 0.99987
> omega 0.000001 NA NA NA
> clearly the two fits are not equivalent. Is there something I’m missing about the external.regressors?
>
>
>
> [[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.
More information about the R-SIG-Finance
mailing list