I am working on writing a codes for different models of financial time series that was provided built-in in the RATS. I try to do this because I need some modification in the variance equation of these models (Univarite and Multivariate) so that I will be able to introduce dummies in the variance equation. If I includes these dummies in variance equation using Xreg option it will introduce these dummies in both equations of volatility. I need different dummies in different equation (for example Mensi at el (2015) in which they introduce dummies for structural variance break). I did the coding by myself and compare the result of my codes (without dummies) with built-in code for verification. I did coding of EGARCH model of Nelson, VARMA-GARCH of McAller and EGRACH model of Koutmos. When I estimate models with my codes and buil-in commands, the results are different even though the likelihood is almost identical. This discrepancy in results mainly in the constant of variance equation(s) and coefficients of spillover effect (multivariate models). I have used same data (d-spcscointc.txt file of Tasy Book) for the estimation of these models. The results and codes are given below for your expert opinion. Kindly guide me so that I will be able to get identical estimates of my models with my codes and built-in commands.
EGARCH Models codes and results
The codes
Code: Select all
open data d-spcscointc.txt
data(format=free,org=columns,top=2) 1 2275 sp500 cisco intel
set r1 = sp500
set r2 = cisco
*
* This replaces your initialization of variances to zero.
*
stats(noprint) r1
set h = %variance
nonlin c0 c1 c a b d
frml e = R1(t)-c0-c1*R1(t-1)
frml var = c+a*(abs(e(t-1)/sqrt(h(t-1)))-sqrt(2/%pi))+b*log(h(t-1))+d*(e(t-1)/sqrt(h(t-1)))
frml gln = h=exp(var(t)), %logdensity(h, e)
smpl 3 2275
compute c0= .17, c1 = 0.13, c = 0.8, a = .1, b = .0003, d=-1
maximize(method=bfgh,iterations=500,rob) glnCode: Select all
GARCH(P=1,Q=1,EXP,ASYMMETRIC,rob,reg) / R1
# constant r1{1}Code: Select all
MAXIMIZE - Estimation by BFGS
Convergence in 24 Iterations. Final criterion was 0.0000032 <= 0.0000100
With Heteroscedasticity/Misspecification Adjusted Standard Errors
Usable Observations 2273
Function Value -2650.6793
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. C0 0.042971207 0.016451077 2.61206 0.00899983
2. C1 0.041454940 0.024626977 1.68331 0.09231429
3. C -0.002161605 0.004352407 -0.49665 0.61943875
4. A 0.124309653 0.028409867 4.37558 0.00001211
5. B 0.983974980 0.007608731 129.32182 0.00000000
6. D -0.074441790 0.022458964 -3.31457 0.00091784
Code: Select all
GARCH Model - Estimation by BFGS
Convergence in 25 Iterations. Final criterion was 0.0000099 <= 0.0000100
With Heteroscedasticity/Misspecification Adjusted Standard Errors
Dependent Variable R1
Usable Observations 2273
Log Likelihood -2651.6327
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Constant 0.043045336 0.014425693 2.98394 0.00284567
2. R1{1} 0.041561338 0.023235316 1.78871 0.07366086
3. C -0.102111331 0.029282510 -3.48711 0.00048827
4. A 0.125353695 0.034747261 3.60758 0.00030906
5. B 0.983915225 0.008372386 117.51909 0.00000000
6. D -0.073425349 0.025383578 -2.89263 0.00382029
Now the codes and results of EGARCH model of Koutmos
The codes
Code: Select all
open data d-spcscointc.txt
data(format=free,org=columns,top=2) 1 2275 sp500 cisco intel
set r1 = sp500
set r2 = cisco
stats(noprint) r1
set h1 = %variance
stats(noprint) r2
set h2 = %variance
nonlin M10 M11 M12 M20 M21 M22 C1 C2 A11 A12 A21 A22 B1 B2 D1 D2 rho
frml e_r1 = r1(t)-M10-M11*r1(t-1)-M12*r2(t-1)
frml e_r2 = r2(t)-M20-M21*r1(t-1)-M22*r2(t-1)
frml fr1 = (abs(e_r1/sqrt(h1))-sqrt(2/%pi))
frml fr2 = (abs(e_r2/sqrt(h2))-sqrt(2/%pi))
frml z1 = e_r1/sqrt(h1)
frml z2 = e_r2/sqrt(h2)
frml var_r1 = exp(c1+a11*(fr1(t-1)+d1*z1(t-1))+a12*(fr2(t-1)+d2*z2(t-1))+b1*log(h1(t-1)))
frml var_r2 = exp(c2+a21*(fr1(t-1)+d1*z1(t-1))+a22*(fr2(t-1)+d2*z2(t-1))+b2*log(h2(t-1)))
frml gln = h1 = var_r1(t), h2 = var_r2(t), %logdensity(||h1|rho*sqrt(h1*h2),h2||,||e_r1,e_r2||)
smpl 3 2275
compute m10 = 01, m20 = .2, m11 = .03, m12 = .04, m21 = .09, m22 = .08
compute c1 = .01, c2 = .04, a11= .04, a22 = .014, a12=.08, a21=.06
compute b1 = .01, b2 = .08, d1 = .04, d2 = .08
compute rho=.08
maximize(method=bfgh,ite=500,pit=20,pmet=sim,rob) glnCode: Select all
GARCH(P=1,Q=1,MV=CC,VARIANCES=KOUTMOS,REGRESSORS,PMETHOD=SIMPLEX,PITERS=20,rob) / R1 R2
# Constant r1{1} R2{1}Code: Select all
MAXIMIZE - Estimation by BFGS
Convergence in 41 Iterations. Final criterion was 0.0000025 <= 0.0000100
With Heteroscedasticity/Misspecification Adjusted Standard Errors
Usable Observations 2273
Function Value -7778.3881
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. M10 0.047121219 0.013493860 3.49205 0.00047933
2. M11 0.003150756 0.022161548 0.14217 0.88694398
3. M12 0.014972792 0.005958371 2.51290 0.01197431
4. M20 0.216337120 0.049657854 4.35655 0.00001321
5. M21 -0.037247364 0.081931155 -0.45462 0.64938420
6. M22 0.048598453 0.024417196 1.99034 0.04655380
7. C1 -0.004762401 0.004252895 -1.11980 0.26279807
8. C2 0.061290660 0.028398115 2.15827 0.03090723
9. A11 0.117066387 0.027882548 4.19855 0.00002686
10. A12 -0.004946090 0.014637982 -0.33789 0.73544288
11. A21 -0.020658764 0.018672091 -1.10640 0.26855429
12. A22 0.105050725 0.026104390 4.02426 0.00005716
13. B1 0.980705644 0.009125211 107.47211 0.00000000
14. B2 0.969549832 0.014492062 66.90213 0.00000000
15. D1 -0.541918842 0.088781796 -6.10394 0.00000000
16. D2 -1.015702303 0.221988135 -4.57548 0.00000475
17. RHO 0.519600274 0.017175700 30.25206 0.00000000
Code: Select all
MV-CC GARCH with Koutmos EGARCH Variances - Estimation by BFGS
Convergence in 53 Iterations. Final criterion was 0.0000047 <= 0.0000100
With Heteroscedasticity/Misspecification Adjusted Standard Errors
Usable Observations 2273
Log Likelihood -7779.2762
Variable Coeff Std Error T-Stat Signif
************************************************************************************
Mean Model(R1)
1. Constant 0.046926041 0.010246796 4.57958 0.00000466
2. R1{1} 0.003722970 0.023917258 0.15566 0.87630072
3. R2{1} 0.015022906 0.005248749 2.86219 0.00420727
Mean Model(R2)
4. Constant 0.215835888 0.042987891 5.02085 0.00000051
5. R1{1} -0.035827949 0.072481894 -0.49430 0.62109288
6. R2{1} 0.048756093 0.023112762 2.10949 0.03490248
7. C(1) -0.094511925 0.022082230 -4.28000 0.00001869
8. C(2) -0.006249044 0.022346638 -0.27964 0.77975267
9. A(1,1) 0.117611736 0.024107562 4.87862 0.00000107
10. A(1,2) -0.020517148 0.016283699 -1.25998 0.20767628
11. A(2,1) -0.005125008 0.013020480 -0.39361 0.69386801
12. A(2,2) 0.105522682 0.025060981 4.21064 0.00002547
13. B(1) 0.980614154 0.006154526 159.33220 0.00000000
14. B(2) 0.969426894 0.013691089 70.80714 0.00000000
15. D(1) -0.537684424 0.118375654 -4.54219 0.00000557
16. D(2) -1.007991695 0.223240584 -4.51527 0.00000632
17. R(2,1) 0.519245244 0.014370774 36.13203 0.00000000
I am facing the same issue with VARMA GARCH model. Now what I should do to over come this issue?
Regards, Irfan Awan