[R-SIG-Finance] Different results on Garch(1, 1) with regressors: Eviews vs rugarch
Eliano Marques
eliano.m.marques at gmail.com
Thu Sep 10 18:41:26 CEST 2015
PS: I’ve also noted that the fit tests typically generate NA Weighted Ljung-Box and Arch LM tests.
Eliano
> On 10 Sep 2015, at 17:38, Eliano Marques <eliano.m.marques at gmail.com> wrote:
>
> Hi Alexios,
>
> So i’ve tried many different methods and I’m still finding it difficult to come anywhere close Eviews results. While i do understand they won’t match to a penny the differences are quite significant at this stage.
>
> What have I done:
>
> 1 - Adding variance.target=0.7
> Results:
> Robust Standard Errors:
> Estimate Std. Error t value Pr(>|t|)
> mu 0.000013 0.348112 0.000039 0.99997
> mxreg1 0.714946 232.642591 0.003073 0.99755 # Eviews with backcast of 0.7 calculates this as 0.7233
> mxreg2 -0.000108 0.267235 -0.000403 0.99968
> mxreg3 0.000031 1.028411 0.000030 0.99998
> mxreg4 -0.000009 0.083789 -0.000106 0.99991
> mxreg5 -0.000009 0.126160 -0.000070 0.99994
> alpha1 0.030775 0.050001 0.615491 0.53823 # Eviews estimates this as 0.14
> beta1 0.969225 0.887995 1.091476 0.27506 #Eviews estimates this as 0.59
> vxreg1 0.000000 0.293709 0.000000 1.00000
> vxreg2 0.000000 0.000168 0.000049 0.99996
> vxreg3 0.000000 0.000299 0.000033 0.99997
> vxreg4 0.000000 0.000407 0.000023 0.99998
> vxreg5 0.000000 0.003602 0.000000 1.00000
> omega 0.000000 NA NA NA
>
> Note that omega now don’t have standard error, t-value and p.value. This is expected given the variance.targeting setting.
>
> Now if I also set Eview variance.target option on (backcast doesn’t turn this on) the results get more similar between softwares. mxreg1 in mean equation is 0.705 (vs. 0.715 in R) and beta1 is eviews is 0.971 (vs. 0.969 in R).
>
> 2 - Set variance.target in Eviews to null
> Problem is the same as above as Eviews results are exactly the same.
>
> 3 - Adding setbounds
> Problem remain.
>
> I guess the issue that i’m facing here is more around the parameters of the variance function in the more simple terms not matching the Eview results. I know the var-cov methods are different but being significantly different is not expected.
>
> The other thing that I have noticed is that if you change the garch model from standard to something else the results typically tend to match better so I wonder if I’m still missing something in the standard garch method.
>
> Thank you,
> Eliano
>
>
>
>> On 10 Sep 2015, at 12:32, alexios galanos <alexios at 4dscape.com> wrote:
>>
>> 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