[R-SIG-Finance] Different results on Garch(1, 1) with regressors: Eviews vs rugarch
alexios galanos
alexios at 4dscape.com
Thu Sep 10 13:32:55 CEST 2015
Discussed numerous times on this forum (i.e. differences between
different software implementations).
As far as I can see from your output, eviews uses:
Presample variance: backcast (parameter = 0.7)
whereas rugarch by default uses the whole sample for the initialization.
See the ugarchspec help function on variance.targeting which allows a numeric value (instead of logical)
between 0 and 1 for the backcasting.
However, it could also be the case of different bound constraints. In the rugarch model, the coefficients
on the external regressors in the variance equation for the sGARCH model are constrained to be positive.
Feel free to play around with 'setbounds<-' and a whole host of other options, including using an alternate
solver etc.
Alexios
On 10/09/2015 13:56, Eliano Marques wrote:
> Hi everyone,
>
> I’m writing a thesis around the stock prices with ISEG in Lisbon.
>
> I wrote the entire end-to-end ETL in R and I’m trying to run all the models in R. Just as a sense check, I was comparing the results between Eviews and R and realised big differences between then and I wonder if you can help me debugging this differences, i’m sure I might be doing something wrong.
>
> Here is my R code:
>
> RFunction_garch_estimation=function( #stock,
> variance.model = list(model = "sGARCH", garchOrder = c(1, 1),
> submodel = NULL, external.regressors = NULL, variance.targeting = FALSE),
> mean.model = list(armaOrder = c(1, 1), include.mean = TRUE, archm = FALSE,
> archpow = 1, arfima = FALSE, external.regressors = NULL, archex = FALSE),
> distribution.model = "norm", start.pars = list(), fixed.pars = list(),
>
> spec, data, out.sample = 0, solver = "solnp", solver.control = list(),
> fit.control = list(stationarity = 1, fixed.se = 0, scale = 0, rec.init = 'all'),
> numderiv.control = list(grad.eps=1e-4, grad.d=0.0001,
> grad.zero.tol=sqrt(.Machine$double.eps/7e-7), hess.eps=1e-4, hess.d=0.1,
> hess.zero.tol=sqrt(.Machine$double.eps/7e-7), r=4, v=2)
> ) {
> library(rugarch)
> mod1=ugarchspec(variance.model = variance.model,
> mean.model = mean.model,
> distribution.model = distribution.model)
> mod1fit=ugarchfit(mod1, data,solver=solver, fit.control, out.sample, solver.control , numderiv.control )
> return(mod1fit) }
>
> #This RFunction just sets the ugarchspec and estimates at the same the garch function.
>
>
> variance_model = list(model = "sGARCH", garchOrder = c(1, 1),
> submodel = NULL, external.regressors = as.matrix(regressors), variance.targeting = FALSE)
> mean_model = list(armaOrder = c(0,0 ), include.mean = TRUE, archm = FALSE,
> archpow = 1, arfima = FALSE, external.regressors = as.matrix(regressors), archex = FALSE)
> distribution_model = "norm"
> #as.matrix(regressors)
> model1=RFunction_garch_estimation( data=target, variance.model = variance_model, mean.model = mean_model,distribution.model = distribution_model,solver='solnp')
> show(model1)
>
> #### Results:
>
> Robust Standard Errors:
> Estimate Std. Error t value Pr(>|t|)
> mu 0.000015 0.234264 0.000063 0.99995
> mxreg1 0.709299 292.613915 0.002424 0.99807
> mxreg2 -0.000112 0.098905 -0.001135 0.99909
> mxreg3 0.000034 0.065088 0.000528 0.99958
> mxreg4 -0.000003 0.075987 -0.000037 0.99997
> mxreg5 -0.000009 0.012701 -0.000723 0.99942
> omega 0.000000 0.000249 0.000175 0.99986
> alpha1 0.020642 1.493492 0.013821 0.98897
> beta1 0.973943 0.908957 1.071496 0.28395
> vxreg1 0.000000 0.030732 0.000000 1.00000
> vxreg2 0.000000 0.000019 0.000469 0.99963
> vxreg3 0.000000 0.001606 0.000007 0.99999
> vxreg4 0.000000 0.000630 0.000015 0.99999
> vxreg5 0.000000 0.000634 0.000000 1.00000
>
> LogLikelihood : 30151.719
>
> Eviews outputs:
>
> Dependent Variable: target
> Method: ML - ARCH (Marquardt) - Normal distribution
> Date: 09/10/15 Time: 11:51
> Sample: 11/05/2014 09:30 8/28/2015 17:30
> Included observations: 6763
> Convergence achieved after 25 iterations
> Bollerslev-Wooldridge robust standard errors & covariance
> Presample variance: backcast (parameter = 0.7)
>
> GARCH = C(7) + C(8)*RESID(-1)^2 + C(9)*GARCH(-1) + C(10)
> *reg1 + C(11)*reg2 + C(12)
> *reg3 + C(13)*reg4 + C(14)
> *reg5
>
> Variable Coefficient Std. Error z-Statistic Prob.
>
> C -1.62E-05 4.17E-05 -0.388964 0.6973
> reg1 0.723305 0.050098 14.43789 0.0000
> reg2 -0.000242 0.000123 -1.972702 0.0485
> reg3 0.000170 8.29E-05 2.049855 0.0404
> reg4 0.000107 0.000175 0.610040 0.5418
> reg5 -1.22E-05 8.26E-06 -1.482648 0.1382
>
>
> Variance Equation
>
> C 9.87E-06 3.85E-06 2.566464 0.0103
> RESID(-1)^2 0.149994 0.035467 4.229165 0.0000
> GARCH(-1) 0.599977 0.118194 5.076196 0.0000
> reg1 -0.000362 0.002233 -0.162239 0.8711
> reg2 1.35E-06 1.18E-05 0.114108 0.9092
> reg3 -5.72E-07 5.44E-07 -1.050865 0.2933
> reg4 -2.28E-06 9.78E-06 -0.232631 0.8160
> reg5 -8.48E-08 2.61E-08 -3.251462 0.0011
>
>
> Now please note that the majority of the external regressors have 0 as coefficient in the conditional variance and this isn't much different from Eviews. However when you look at the coefficients alpha and beta they significantly differ from Eviews. In addition, both methods using the robust matrix of cov-var, the p-value of a large number of coefs. differ.
>
> Could you help me understand if I’m doing anything wrong in the R bit?
>
> Thank you,
> Eliano
>
> _______________________________________________
> 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