I modelled a stock's volatility using the "rugarch" package in R and Eviews.
The estimated model is GARCH(1,1).
Data is as below:
> dput(datax)
c(0.00240428226573286, 0.00718664351112785, 0.00417663958775449,
-0.0124234291416307, 0.00615240249156912, 0.0096846888172486,
0.0106526433200909, -0.00786660798829253, -0.0122874870756498,
-0.000314141256930967, 0.000471174886371273, -0.0208884504520821,
-0.0149969692551366, 0.0241492647161508, 0.00419227605454964,
0.0178426729434715, 0.00339145325161994, 0.00518480259013288,
0.0144432753009873, -0.000454914348644309, -0.0129016560881787,
0.0104447845272464, 0.0167547608104748, -0.00405921117604713,
-0.0300729637845212, -0.00822872240789607, 0.00278348586175703,
-0.00943594943234238, -5.99101840794702e-05, 0.000996016229104058,
-0.000829404324086624, 0.0258218725118393, 0.00877055916031999,
-0.00588618984169464, 0.0254017935654574, 0.00805703215794296,
-0.0191565531978934, 0.0152034393746021, -0.00363509820161312,
0.0117471147043791, 0.00185834076893698, 0.0109010059113128,
0.000525595380350907, 0.00471136142307849, 0.00378484394178535,
0.00256537092911024, 0.0134933997293825, 0.00363203707933835,
0.00448837964129467, 0.00916296013641471, -0.0135706087748861,
0.00426982136304233, 0.0249833876507619, 0.019064654422376, 0.00552211291815752,
-0.0198178211588615, -0.0170519265736608, 0.0120525451282543,
-2.37224843004924e-05, -0.000146280600871407, 0.00477158577627002,
0.014383729883134, 0.00421564947003716, -0.0109717193626331,
0.0182095942293206, -0.0108949339087712, -0.0176664501445263,
-0.00426136213898864, 0.0163439380148436, 0.0178444666710593,
-0.00319282678270305, 0.0233384597132087, 0.00102961481001707,
-0.00247084887334204, 0.00896252965220334, -0.00107396173656049,
-0.00815784718500012, 0.00140858905036012, 0.00184093926106854,
-0.00841584807540308, 0.0075738167721191, -0.00446712175714303,
0.00121321378245653, -0.00175673411449218, -0.0177111606464013,
-0.0334792540725228, -0.021030442634931, -0.00865103680757429,
-0.00421196940949287, 0.00881717323241915, -0.00329042016708669,
0.00285661638368673, -0.0091984467251045, -0.00635158904182198,
-0.0104482543279794, 0.00359730221733479, -0.000431138620978544,
-0.0115382875664558, 0.00533047803197206, 0.0341741617915705,
-0.0104470816276567, -0.00732144270561363, -8.62463751900577e-05,
0.00646817036545677, -0.00936218069462136, -0.00992630520256377,
-0.00995174579671421, 0.0241883533000227, 0.00578491104143275,
-0.00555291698752569, 0.00859969423753348, -0.0143210399197393,
-0.0106656279629131, -0.00460249153100456, -0.010173846679443,
0.00628725502787653, -0.0207505962948851, 0.0101111964328382,
0.0273637272462803, 0.000106801184665883, -0.00340971899708542,
0.00930603680385644, -0.0342227015274759, -0.00272057238669277,
0.0232516656596928, -0.00282957942797246, 0.00137068445465083,
0.0146662205383272, 0.00557236352191204, -0.00470848819449188,
0.01545895026171, 0.0237779175036614, 0.0022179786175851, 0.0154723164160355,
0.00284859279265781, -0.0734795439085705, -0.0101844065754371,
-0.0168785371789415, -0.0451668472504849, 0.00200162750463484,
0.0333872319914033, -0.00655444963038754, 0.0186375681927853,
0.00224002580098137, 0.00214365086334034, 0.01717336389666, -0.0119039720455039,
-0.0166511258509399, 0.0208862527198921, -0.000787824156615713,
0.0222754484996237, 0.00954288703328032, -0.00727556935841456,
0.0137326236782958, -0.0102379006489173, 0.00311433870608724,
-0.0098021206176373, 0.00565514504945241, -0.00226609648997211,
0.00223756041797607, -0.00246408074099946, -0.0079808840138309,
-0.0158660954154453, 0.00881042570067692, 0.00428512104701007,
-0.0130623086945807, -0.00198847471210328, -0.00151270842662043,
0.0135073344736334, 0.0117315016530082, 0.00260857338333409,
-0.00451831385594481, 0.00257655670181478, -0.0101997675299845,
-0.0135002265633961, 0.0214784602834559, -0.00461067140901328,
0.00776184432271698, 0.0238427144319235, -0.000495135212737807,
-0.0387403757953813, 0.00565275629502793, 0.00667937353452963,
-0.00776691741432067, -0.00766349350523576, 0.00958945509957054,
-0.00217288868014798, 0.0102753819264656, 0.000527389159218572,
0.00104278741483199, -0.00180603147915903, -0.0024659310273023,
-0.00235092677265314, -0.00843919357593137, 0.00963829977017916,
-0.00150498322541637, 0.0115911140449825, 0.0110373532490922,
0.000537162615545483, -0.00517091804718639, 0.013716249701627,
-0.00626535235492476, -0.00044537835702485, -0.00833167889318887,
-0.00517343387401326, 0.00259197243534537, -0.0142035782174386,
-0.00332432066398702, -0.00637259964301151, -0.0319897877349788,
0.0188708261874773, 0.00902118748854797, -0.00208183811690787,
0.00198454105666279, -0.0156560254475639, -0.0100950585869821,
0.00978093861225737, -0.00522315899479864, 0.00503232384557784,
0.00666876157161944, -0.00126191845920864, 0.00354688366125622,
-0.0102764670148119, -0.0113092429587738, 0.00229380810354662,
0.00839328069543654, -0.0105198364905359, -0.002837775658179,
-0.0201399087459038, 0.0119401772698691, 0.00284045488011309,
0.0246084027100704, 0.00788890594633074, -0.00133535072794366,
-0.00266444216114259, 0.00674294083180094, 0.00986258515676042,
-0.00148717060305792, 0.0103228516356264, -0.00114563042290783,
-0.00558149616106718, 0.00839029408001757, -0.00242454214368415,
-0.00277027874972191, -0.00560435091364653, 0.000731425659337148,
-0.00428107774040676, 0.0109993438147029, 0.0037087621145826,
0.00388281880721841, -0.00492902801425465, -0.0147212663223222,
-0.0062137466061678, 0.00318246089141461, 0.00938513022545173,
0.00372645244357095, -9.69066555711606e-06, 0.0035197962925686,
0.0406780148963204, 0.0077983167274418, 0.00229569544477393,
0.00793643833981328, 0.00504391169459417, -0.00580243023076754,
0.00927432095852687, -0.000232971205631927, 0.0138722766791695,
-0.0129039060692566, 0.00836494753892758, 1.01399352825382e-05,
0.0283457779811229, 0.00067442071407342, 0.00637900121597035,
0.00626980084182271, 0.0113243798290323, -0.0117401689487977,
0.00135979977779499, 0.00879045569253378, 0.00656352401512272,
-0.0153928479424028, 0.0125530726116168, -0.00561643658804734,
-0.00227591872884325, 0.0034633081250135, 0.00727107400641813,
-0.00273647607013316, 0.00425203735149005, -0.00488867171599416,
0.00683394561459849, -0.00992043957091049, -0.00560198247430499,
-0.00327635391489345, 0.0208371203446358, 0.00684650777054152,
-0.00235817540968775, 0.0146372216938975, -0.00254461570527909,
-0.0147392682797047, -0.00540476259961409, 0.00681741066701314,
-0.00202936679798782, -0.00328393800144688, 0.0034608210234186,
0.00915650804831181, 0.0024681397557007, 0.00452850517684666,
-0.00325770029997052, -0.00883931780571601, -0.000500965633410289,
0.00686775854728872, -0.00763740444788219, 0.00541127306787104,
-0.0101645080291242, 0.000140351294030339, -0.00375751614814845,
-0.00312954762505058, -0.000642140719694595, 0.0047835723077192,
-0.00403350849344264, -0.00205117718248182, 0.0305259473841222,
-0.00368893454833596, 0.000524259091893242, -0.0119619058683504,
0.00214533859236532, 0.00653076907380878, 0.00791071061486903,
-0.0062537972532688, 0.0135117597884715, 0.00416939885856848,
0.0148088851181498, 0.00883162254853787, -0.00119022679055902,
-0.00254082633103003, 0.00394659516152096, -0.003168068545504,
-0.00524040660809355, -0.00882022385438397, 0.00951940493577297,
-0.00101927410289804, 0.015761701773787, 0.00909395368709731,
-0.0112922617960063, -0.00123833318798283, 0.00620620396185423,
0.00598439589524169, -0.00455009463326661, -0.00605233754141565,
0.0130798753275556, 0.0135739452716361, 0.00608364063475264,
-0.00613010218358134, -0.00184034344641404, 0.00197347969190886,
-0.00387874641259245, 0.00199036225790472, -0.00180383171416842,
0.0153096987521142, -0.00686017554850871, 0.0014203900944505,
-0.00729808882639027, 0.00369152733962785, 0.00980434412762321,
0.00503305294462741, -0.00143341801999597, 0.00338400714536036,
-0.00906640410340387, -0.00552950392268947, 0.0115387367679265,
-0.000633026777244083, 0.00121665545139571, 0.00683871348798348,
-0.00434128430549308, 0.00977794561054779, -0.00425650993954818,
0.00249283999941774, 0.000815176235308357, 0.00679613674310175,
-0.00458861771460839, -0.001166401766314, -0.00540718042119614,
0.0100685043595448, 0.0204185872102673, 0.00605956410345243,
0.00385001917730676, 0.00922236514154662, 0.00985160106128902,
-0.00470606734079837, 0.01594519327646, -0.00636892362420838,
0.00100412807768002, -0.00123875407891383, 0.00308910806569429,
0.00154485396972071, 0.0109979003939937, -0.00640462572168055,
-0.0015637144202536, -0.0129542930903757, 0.0035548530292111,
0.00588116908225444, 0.0129026905494971, 0.0113209668876699,
-0.00129441124807883, -0.00846832936736064, -0.00844436119602499,
-0.00779763940020217, 0.023781763109044, -0.0242478267815525,
-0.000479662645538781, -0.000343118163115719, 0.00352384560039809,
0.0130894063298506, -0.000188021398532356, 0.00329381722090716,
0.0018447861748303, 0.0054929799543082, 0.00531453264371429,
0.000753024431418226, -0.00374371676477558, -0.0103937514181691,
0.0067629682572683, 0.0011958712688962, -0.0118359004134643,
0.00923609281688798, -0.00300438045761275, -0.00896634115784245,
0.000819686759950145, -0.00465327468340249, -0.0112668808388143,
-0.0152929145318392, 0.00386127972024042, -0.0126357426677117,
0.0011690144781813, -0.0179534149314371, 0.0160931118496812,
-0.0264315783876601, 0.0140562888877458, 0.00249690206283404)
The R code is:
library(rugarch)
datax<-as.data.frame(datax)
model11<-ugarchspec(variance.model=list(model="sGARCH",
garchOrder = c(1,1),
external.regressors =NULL),
mean.model=list(armaOrder=c(0,0), include.mean=FALSE),
distribution.model = "norm")
fit11<-ugarchfit(data=datax,spec=model11)
The estimated coefficients with "rugarch" are without intercept in mean equation:
> fit11
*---------------------------------*
* GARCH Model Fit *
*---------------------------------*
Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(0,0,0)
Distribution : norm
Optimal Parameters
------------------------------------
Estimate Std. Error t value Pr(>|t|)
omega 0.000001 0.000002 0.63044 0.528405
alpha1 0.025113 0.014814 1.69521 0.090035
beta1 0.963648 0.016994 56.70583 0.000000
Robust Standard Errors:
Estimate Std. Error t value Pr(>|t|)
omega 0.000001 0.000022 0.068042 0.94575
alpha1 0.025113 0.112516 0.223197 0.82338
beta1 0.963648 0.138717 6.946883 0.00000
The estimated coefficients with "rugarch" are with intercept in mean equation:
> fit11
*---------------------------------*
* GARCH Model Fit *
*---------------------------------*
Conditional Variance Dynamics
-----------------------------------
GARCH Model : sGARCH(1,1)
Mean Model : ARFIMA(0,0,0)
Distribution : norm
Optimal Parameters
------------------------------------
Estimate Std. Error t value Pr(>|t|)
mu 0.001090 0.000531 2.05445 0.039932
omega 0.000001 0.000004 0.30336 0.761618
alpha1 0.026484 0.030789 0.86018 0.389691
beta1 0.964029 0.033893 28.44323 0.000000
Robust Standard Errors:
Estimate Std. Error t value Pr(>|t|)
mu 0.001090 0.001997 0.545712 0.58526
omega 0.000001 0.000076 0.016534 0.98681
alpha1 0.026484 0.542671 0.048803 0.96108
beta1 0.964029 0.603895 1.596352 0.11041
Using the same data I estimated GARCH(1,1) model with EViews. The results are:
Dependent Variable: RETURN
Method: ML ARCH - Normal distribution (BFGS / Marquardt steps)
Date: 10/30/17 Time: 19:49
Sample: 1 438
Included observations: 438
Convergence achieved after 22 iterations
Coefficient covariance computed using outer product of gradients
Presample variance: backcast (parameter = 0.7)
GARCH = C(1) + C(2)*RESID(-1)^2 + C(3)*GARCH(-1)
Variable Coefficient Std. Error z-Statistic Prob.
C 6.30E-06 3.63E-06 1.738057 0.0822
RESID(-1)^2 0.042247 0.017263 2.447164 0.0144
GARCH(-1) 0.912332 0.039907 22.86162 0.0000
R-squared -0.005593 Mean dependent var 0.000863
Adjusted R-squared -0.003297 S.D. dependent var 0.011552
S.E. of regression 0.011571 Akaike info criterion -6.108230
Sum squared resid 0.058645 Schwarz criterion -6.080269
Log likelihood 1340.702 Hannan-Quinn criter. -6.097197
Durbin-Watson stat 1.965053
So, there is some slight differences between the estimates:
- "rugarch" estimates the GARCH coefficient as
0.963
while EViews0.912
. - "rugarch" estimates the error coefficient as
0.025
while EViews0.042
.
And also the estimated standard errors are different.
Are those differences natural? Or am I doing something wrong?
Best Answer
The behavior that you see is due to the presample variance option in EViews.
rugarch
uses the variance of all data points and EViews uses backcasting using a parameter of 0.7. More precisely, EViews uses this formula for initialization of the variance:$\sigma_0^2 = \lambda \hat\sigma^2 + (1-\lambda) \sum_{t=0}^T \lambda^{T-t-1} \cdot \varepsilon_{T-t}^2$
where $\lambda$ is the backcast parameter (default in EViews: 0.7, default in
rugarch
,fGarch
, and gretl: 1.0) and $\hat\sigma^2$ is the unconditional variance of all residuals $\varepsilon_1, \ldots, \varepsilon_T$.This is the explanation in the EViews manual regarding this choice of the variance initialization (whatever
outperform
means for them):Using the same approach as
rugarch
, we get:which is quite close to the estimates of
rugarch
. However, we still see some differences in the standard errors: they are lower forrugarch
resulting in differences regarding hypothesis testing of the GARCH parameters.For comparison, these are the estimates using the
fGarch
library for R:and gretl:
which seem to be more similar to EViews than to
rugarch
.What astonishes me most is the drop in the standard errors of the
rugarch
estimates: e.g. from 57 to 28, or from 1.7 to 0.9 - they appear as if they were halved.Maybe this finding is worth posting on the R-SIG-Finance mailing list as we don't observe such a drop in the estimated standard errors for the other packages / programs.
fGarch
without mean:gretl without mean:
EViews without mean: