Examples / VARMAGARCH.RPF |
VARMAGARCH.RPF is an example of a multivariate GARCH model with VAR and VARMA mean models. Don't confuse the "VARMA-GARCH" with the (Chan and McAleer) VARMA model for the variances.
While GARCH models with a VAR mean model are common, VARMA mean models are much less common and for good reason. In the time series literature, VAR's are overwhelmingly chosen for two reasons:
1.they're much simpler to estimate
2.they don't suffer from identification/cancellation problems. (See, for instance, Section 12.1.1 of Lutkepohl(2006)).
For a GARCH model, the first of these doesn't really apply since, either way, you have to use non-linear estimation. However, the second is still an issue, and this is particularly true with the typical application for GARCH models, which are return series with (at most) fairly weak serial correlation. There is very little harm in adding extra (unnecessary) VAR lags to a VAR-GARCH model unless the data set is quite short compared to the typical GARCH data set. However, adding an unnecessary MA to the mean can produce a model which is effectively unidentified.
While this problem with the mean model will generally have little effect on the estimates of the variance model, it can make it much more difficult to get the overall model to converge. This example has no problem estimating a DVECH and BEKK model to a VAR(1) mean, but uses the PMETHOD=GA (added with RATS 9.2) to one of the models with the VARMA(1,1) mean because of problems getting the model to behave, and needs almost 500 iterations to get the other to converge.
This uses @VARLAGSELECT to try various lag lengths for a VAR to explain the mean, the first using BIC (SBC) and the second AIC.
@varlagselect(lags=5,crit=bic)
# reuro rpound rsw
@varlagselect(lags=5,crit=aic)
# reuro rpound rsw
As one can see, the two have very different ideas. The calculations used in these don't allow for heteroscedasticity, so you really can't use them as another more than a guide. In general, it's best to start with a small model, and only go to a more complicated one if diagnostics show that the smaller model isn't adequate. In this case, we'll use a VAR(1) as the starting point. This sets up an estimates a DVECH model with a VAR(1) mean:
system(model=simplevar)
variables reuro rpound rsw
lags 1
det constant
end(system)
nlpar(derives=fourth,exactline)
garch(p=1,q=1,model=simplevar,distrib=t,$
pmethod=simplex,piters=10,iters=500,stdresids=stdu)
The NLPAR instruction to use slower but more accurate calculations isn't really necessary for this model, but is needed for later ones. This estimates a BEKK with the same mean model:
garch(p=1,q=1,model=simplevar,distrib=t,mv=bekk,$
pmethod=simplex,piters=10,iters=500,stdresids=stdu)
The estimates of the parameters on the means are almost identical, and, while some of the lag coefficients are statistically significant, none of them are "economically" large—you would be hard-pressed to see any difference between these data and white noise in a graph. More to the point, the diagnostics (here for the VAR(1)-BEKK model) show that the VAR(1) model has done its job of producing serially uncorrelated standardized residuals (highly insignificant Q statistic). The test for residual ARCH might be disappointing, but that would require looking more carefully at the "GARCH" part of this model, not the mean (and is outside the scope of this example).
Even though there is no reason to continue to a more complicated VARMA(1,1) model here, we will do it for illustration. Again, you should never start with a VARMA model, even if you find a paper which has used a VARMA model on a similar data set. The mean model is specific to a data set, and you should choose the simplest one you can find that is able to produce serially uncorrelated residuals.
The setup of the mean model for a full VARMA (lagged residuals from each variable in each equation) is
dec vect[series] u(3)
system(model=varma)
variables reuro rpound rsw
lags 1
det constant u(1){1} u(2){1} u(3){1}
end(system)
*
clear(zeros) u
The U's are the residuals, with U(1) being the residual for the first equation (for REURO), U(2) for RPOUND, etc. The diagonal VECH with this mean model is done using:
garch(p=1,q=1,model=varma,rvector=rv,uadjust=%pt(u,t,rv(t)),distrib=t,$
pmethod=ga,piters=5,iters=500,stdresids=stdu)
The key additions here are the RVECTOR=RV and UADJUST=%PT(U,T,RV(T)) options. UADJUST is an option which gets inserted into the GARCH calculation after the residuals have been computed for a given time period. The RVECTOR option supplies a SERIES[VECTOR], and it copies the residuals at time T into entry T of that (so RV(T) are the residuals at T). The %PT splits the VECTOR RV(T) into the separate elements of U so they can be used at the next period as the lag of U(1), ...
Not surprisingly (given the fact that we saw no obvious serial correlation left behind by the VAR(1)), the log likelihoods for the VARMA models are only slightly better than the VAR and the more complicated models would be rejected by any of the standard information criteria. And the resulting (mean model) coefficient estimates, particularly in the BEKK model show all the signs of the VARMA identification problem with wild values with the AR and corresponding MA being nearly equal with opposite signs. Note that the GARCH coefficients are almost the same when you compare the two BEKK's with each other—the odd coefficients in the mean basically cancel each other out leaving roughly the same residuals.
Full Program
open data "exrates(daily).xls"
calendar(d) 2000:1:3
data(format=xls,org=columns) 2000:01:03 2008:12:23 aust euro pound sw ca
*
* We generally recommend that the returns be multiplied up by 100, which
* changes the scales on the variances by 10000. This puts the
* coefficients in the GARCH within a few orders of magnitude of 1, which
* makes them easier to read. It also makes it easier to estimate the
* model. Note that this doesn't affect the lagged variance or lagged
* squared residual terms in the GARCH specification; just the means
* (which will be higher by x 100) and the constants in the GARCH, which
* will be higher by x 10000.
*
set reuro = 100.0*log(euro/euro{1})
set rpound = 100.0*log(pound/pound{1})
set rsw = 100.0*log(sw/sw{1})
*
spgraph(vfields=3,footer="Exchange rate returns")
graph(header="Euro")
# reuro
graph(header="UK Pound")
# rpound
graph(header="Swiss Franc")
# rsw
spgraph(done)
*
@varlagselect(lags=5,crit=bic)
# reuro rpound rsw
@varlagselect(lags=5,crit=aic)
# reuro rpound rsw
*
* VAR-GARCH
*
system(model=simplevar)
variables reuro rpound rsw
lags 1
det constant
end(system)
*
* Diagonal VECH model for one lag VAR
*
nlpar(derives=fourth,exactline)
garch(p=1,q=1,model=simplevar,distrib=t,$
pmethod=simplex,piters=10,iters=500,stdresids=stdu)
*
* BEKK on one lag VAR
*
garch(p=1,q=1,model=simplevar,distrib=t,mv=bekk,$
pmethod=simplex,piters=10,iters=500,stdresids=stdu)
*
* Tests for residual ARCH, and for residual serial correlation
*
@mvarchtest(lags=5)
# stdu
@mvqstat(lags=5)
# stdu
*
* VARMA(1,1)-GARCH
*
dec vect[series] u(3)
system(model=varma)
variables reuro rpound rsw
lags 1
det constant u(1){1} u(2){1} u(3){1}
end(system)
*
clear(zeros) u
*
* Diagonal VECH on VARMA(1,1) mean model
*
garch(p=1,q=1,model=varma,rvector=rv,uadjust=%pt(u,t,rv(t)),distrib=t,$
pmethod=ga,piters=5,iters=500,stdresids=stdu)
*
* BEKK on VARMA(1,1) mean model
*
garch(p=1,q=1,model=varma,rvector=rv,uadjust=%pt(u,t,rv(t)),distrib=t,mv=bekk,$
pmethod=simplex,piters=20,iters=1000)
*
* Tests for residual ARCH, and for residual serial correlation
*
@mvarchtest(lags=5)
# stdu
@mvqstat(lags=5)
# stdu
Output
Lags SBC/BIC
0 3.10059950*
1 3.11338393
2 3.13335378
3 3.15647962
4 3.17731837
5 3.19583282
VAR Lag Selection
Lags AICC
0 3.09320859
1 3.08383353
2 3.08166378
3 3.08267000
4 3.08140919
5 3.07784420*
Convergence in 141 Iterations. Final criterion was 0.0000000 <= 0.0000100
Daily(5) Data From 2000:01:05 To 2008:12:23
Usable Observations 2340
Log Likelihood -2567.2677
Variable Coeff Std Error T-Stat Signif
************************************************************************************
Mean Model(REURO)
1. REURO{1} 0.209378532 0.014739656 14.20512 0.00000000
2. RPOUND{1} -0.054730387 0.025512607 -2.14523 0.03193453
3. RSW{1} -0.164985452 0.015213740 -10.84450 0.00000000
4. Constant 0.020228580 0.009917240 2.03974 0.04137635
Mean Model(RPOUND)
5. REURO{1} 0.140880988 0.031692402 4.44526 0.00000878
6. RPOUND{1} 0.016754971 0.025728358 0.65123 0.51490073
7. RSW{1} -0.133025025 0.027428857 -4.84982 0.00000124
8. Constant 0.017347793 0.009131388 1.89980 0.05745964
Mean Model(RSW)
9. REURO{1} 0.161174596 0.014875119 10.83518 0.00000000
10. RPOUND{1} -0.057871752 0.028037476 -2.06409 0.03900960
11. RSW{1} -0.132581133 0.018848976 -7.03386 0.00000000
12. Constant 0.013508000 0.010993365 1.22874 0.21916888
13. C(1,1) 0.002634720 0.000973294 2.70701 0.00678913
14. C(2,1) 0.002005687 0.000849551 2.36088 0.01823166
15. C(2,2) 0.002493164 0.001211333 2.05820 0.03957100
16. C(3,1) 0.002454412 0.000994691 2.46751 0.01360554
17. C(3,2) 0.001731103 0.000789840 2.19171 0.02840028
18. C(3,3) 0.002972899 0.001295928 2.29403 0.02178865
19. A(1,1) 0.031943246 0.004991266 6.39983 0.00000000
20. A(2,1) 0.027536881 0.004525767 6.08447 0.00000000
21. A(2,2) 0.033246759 0.005332250 6.23503 0.00000000
22. A(3,1) 0.029698073 0.004720785 6.29092 0.00000000
23. A(3,2) 0.026493859 0.004139350 6.40049 0.00000000
24. A(3,3) 0.029480817 0.004864696 6.06016 0.00000000
25. B(1,1) 0.962696735 0.006296626 152.89089 0.00000000
26. B(2,1) 0.965449092 0.006519007 148.09756 0.00000000
27. B(2,2) 0.960353014 0.007564946 126.94778 0.00000000
28. B(3,1) 0.965523559 0.006053045 159.51039 0.00000000
29. B(3,2) 0.968442355 0.005470510 177.02964 0.00000000
30. B(3,3) 0.965480199 0.006454291 149.58734 0.00000000
31. Shape 7.094912590 0.506860722 13.99776 0.00000000
MV-GARCH, BEKK - Estimation by BFGS
Convergence in 185 Iterations. Final criterion was 0.0000013 <= 0.0000100
Daily(5) Data From 2000:01:05 To 2008:12:23
Usable Observations 2340
Log Likelihood -2552.0530
Variable Coeff Std Error T-Stat Signif
************************************************************************************
Mean Model(REURO)
1. REURO{1} 0.202357368 0.049417457 4.09486 0.00004224
2. RPOUND{1} -0.054588791 0.029286178 -1.86398 0.06232480
3. RSW{1} -0.161712868 0.041338404 -3.91193 0.00009156
4. Constant 0.021629962 0.010249763 2.11029 0.03483348
Mean Model(RPOUND)
5. REURO{1} 0.136150241 0.044390267 3.06712 0.00216133
6. RPOUND{1} 0.016651036 0.027192528 0.61234 0.54031372
7. RSW{1} -0.130990704 0.038082594 -3.43965 0.00058247
8. Constant 0.018778884 0.009416485 1.99426 0.04612405
Mean Model(RSW)
9. REURO{1} 0.151980119 0.052812017 2.87776 0.00400514
10. RPOUND{1} -0.057125209 0.031981121 -1.78622 0.07406420
11. RSW{1} -0.126641992 0.045417971 -2.78837 0.00529744
12. Constant 0.014522802 0.011348255 1.27974 0.20063705
13. C(1,1) 0.033314660 0.010536408 3.16186 0.00156764
14. C(2,1) 0.048656603 0.011643402 4.17890 0.00002929
15. C(2,2) -0.001807824 0.008481230 -0.21316 0.83120537
16. C(3,1) 0.014180181 0.013571313 1.04486 0.29608565
17. C(3,2) -0.023470938 0.008102760 -2.89666 0.00377159
18. C(3,3) 0.000000403 0.180368205 2.23542e-06 0.99999822
19. A(1,1) 0.228246320 0.040490239 5.63707 0.00000002
20. A(1,2) 0.124476004 0.042162724 2.95228 0.00315441
21. A(1,3) -0.035090265 0.042202712 -0.83147 0.40570849
22. A(2,1) 0.027015850 0.025432890 1.06224 0.28812643
23. A(2,2) 0.174821831 0.025708908 6.80005 0.00000000
24. A(2,3) 0.000099984 0.024813469 0.00403 0.99678501
25. A(3,1) -0.105428817 0.032071604 -3.28729 0.00101155
26. A(3,2) -0.118505953 0.033529656 -3.53436 0.00040876
27. A(3,3) 0.157890704 0.036983481 4.26922 0.00001962
28. B(1,1) 0.963427203 0.009213238 104.56989 0.00000000
29. B(1,2) -0.026675663 0.010298271 -2.59030 0.00958910
30. B(1,3) 0.005216031 0.009343084 0.55828 0.57665510
31. B(2,1) -0.016279312 0.005018437 -3.24390 0.00117905
32. B(2,2) 0.973336158 0.005690512 171.04545 0.00000000
33. B(2,3) -0.004625606 0.004879547 -0.94796 0.34315080
34. B(3,1) 0.034784451 0.008986944 3.87055 0.00010859
35. B(3,2) 0.032941371 0.010418409 3.16184 0.00156774
36. B(3,3) 0.989573991 0.009842454 100.54139 0.00000000
37. Shape 7.253427847 0.587890218 12.33807 0.00000000
Statistic Degrees Signif
346.97 180 0.00000
Multivariate Q(5)= 33.52557
Significance Level as Chi-Squared(45)= 0.89599
Convergence in 178 Iterations. Final criterion was 0.0000000 <= 0.0000100
Daily(5) Data From 2000:01:05 To 2008:12:23
Usable Observations 2340
Log Likelihood -2561.8457
Variable Coeff Std Error T-Stat Signif
************************************************************************************
Mean Model(REURO)
1. REURO{1} -0.014068067 0.061817711 -0.22757 0.81997790
2. RPOUND{1} -0.071901125 0.086224632 -0.83388 0.40434776
3. RSW{1} 0.296274478 0.132965742 2.22820 0.02586708
4. Constant 0.018708139 0.009637512 1.94118 0.05223652
5. U(1){1} 0.213008646 0.052628964 4.04737 0.00005180
6. U(2){1} 0.015875540 0.080567403 0.19705 0.84379100
7. U(3){1} -0.450225763 0.125213645 -3.59566 0.00032357
Mean Model(RPOUND)
8. REURO{1} 1.029854862 0.360632235 2.85569 0.00429430
9. RPOUND{1} -0.018288971 0.253789264 -0.07206 0.94255128
10. RSW{1} -0.711495672 0.271801522 -2.61770 0.00885238
11. Constant 0.007024168 0.009524326 0.73750 0.46081980
12. U(1){1} -0.902671268 0.375303541 -2.40518 0.01616466
13. U(2){1} 0.032383172 0.261206380 0.12398 0.90133473
14. U(3){1} 0.590538189 0.279278450 2.11451 0.03447139
Mean Model(RSW)
15. REURO{1} 0.243841113 0.119037874 2.04843 0.04051759
16. RPOUND{1} 0.050986040 0.097698763 0.52187 0.60176094
17. RSW{1} 0.022280890 0.078779112 0.28283 0.77730916
18. Constant 0.007428452 0.009648878 0.76988 0.44137266
19. U(1){1} -0.096995349 0.130298561 -0.74441 0.45662941
20. U(2){1} -0.104644228 0.093434722 -1.11997 0.26272590
21. U(3){1} -0.146766672 0.082000314 -1.78983 0.07348115
22. C(1,1) 0.002519787 0.000827763 3.04409 0.00233384
23. C(2,1) 0.001920914 0.000764742 2.51185 0.01201015
24. C(2,2) 0.002493618 0.001048227 2.37889 0.01736479
25. C(3,1) 0.002327588 0.000824076 2.82448 0.00473573
26. C(3,2) 0.001660800 0.000658103 2.52362 0.01161546
27. C(3,3) 0.002815421 0.001010467 2.78626 0.00533206
28. A(1,1) 0.030797429 0.004863732 6.33206 0.00000000
29. A(2,1) 0.026822131 0.004319575 6.20944 0.00000000
30. A(2,2) 0.033002494 0.005172154 6.38080 0.00000000
31. A(3,1) 0.028573522 0.004543561 6.28879 0.00000000
32. A(3,2) 0.025880691 0.003667200 7.05734 0.00000000
33. A(3,3) 0.028392681 0.004530741 6.26667 0.00000000
34. B(1,1) 0.964114424 0.006212524 155.18884 0.00000000
35. B(2,1) 0.966574557 0.006798803 142.16835 0.00000000
36. B(2,2) 0.960648145 0.007529196 127.58974 0.00000000
37. B(3,1) 0.966947751 0.005870076 164.72492 0.00000000
38. B(3,2) 0.969368920 0.005351879 181.12683 0.00000000
39. B(3,3) 0.966892257 0.005908982 163.63095 0.00000000
40. Shape 7.096699684 0.586627405 12.09746 0.00000000
MV-GARCH, BEKK - Estimation by BFGS
Convergence in 473 Iterations. Final criterion was 0.0000028 <= 0.0000100
Daily(5) Data From 2000:01:05 To 2008:12:23
Usable Observations 2340
Log Likelihood -2545.7617
Variable Coeff Std Error T-Stat Signif
************************************************************************************
Mean Model(REURO)
1. REURO{1} 1.197973087 1.088459189 1.10061 0.27106482
2. RPOUND{1} -0.375758570 0.429955364 -0.87395 0.38214665
3. RSW{1} -0.978191605 1.073632934 -0.91110 0.36224041
4. Constant 0.017536012 0.011823086 1.48320 0.13802105
5. U(1){1} -1.000174100 1.090184332 -0.91744 0.35891434
6. U(2){1} 0.322980232 0.431329341 0.74880 0.45397661
7. U(3){1} 0.819366218 1.075548905 0.76181 0.44617213
Mean Model(RPOUND)
8. REURO{1} 2.629415188 1.209259048 2.17440 0.02967496
9. RPOUND{1} -0.441259163 0.464093225 -0.95080 0.34170665
10. RSW{1} -2.333492926 1.159377359 -2.01271 0.04414492
11. Constant 0.003944563 0.014978619 0.26335 0.79228372
12. U(1){1} -2.500322236 1.206782390 -2.07189 0.03827556
13. U(2){1} 0.457294637 0.458770350 0.99678 0.31886969
14. U(3){1} 2.206587053 1.159738083 1.90266 0.05708495
Mean Model(RSW)
15. REURO{1} 1.519626499 1.132095336 1.34231 0.17949447
16. RPOUND{1} -0.293750512 0.411214445 -0.71435 0.47501157
17. RSW{1} -1.382372944 1.136911016 -1.21590 0.22402207
18. Constant 0.007000370 0.013015217 0.53786 0.59067343
19. U(1){1} -1.363200982 1.122993183 -1.21390 0.22478606
20. U(2){1} 0.239052070 0.408971080 0.58452 0.55887003
21. U(3){1} 1.249578535 1.133583297 1.10233 0.27031990
22. C(1,1) 0.034213022 0.010113951 3.38276 0.00071763
23. C(2,1) 0.050192336 0.011277299 4.45074 0.00000856
24. C(2,2) -0.001915260 0.008698759 -0.22018 0.82573390
25. C(3,1) 0.014928358 0.013094839 1.14002 0.25427860
26. C(3,2) -0.022782208 0.008005922 -2.84567 0.00443182
27. C(3,3) -0.000002833 0.164597998 -1.72109e-05 0.99998627
28. A(1,1) 0.232921972 0.040242930 5.78790 0.00000001
29. A(1,2) 0.134609352 0.041568816 3.23823 0.00120274
30. A(1,3) -0.029775690 0.041756608 -0.71308 0.47579792
31. A(2,1) 0.024957849 0.025218424 0.98967 0.32233678
32. A(2,2) 0.173336601 0.025413602 6.82062 0.00000000
33. A(2,3) -0.000333230 0.024379477 -0.01367 0.98909447
34. A(3,1) -0.108166526 0.031655198 -3.41702 0.00063310
35. A(3,2) -0.125795359 0.033249927 -3.78333 0.00015475
36. A(3,3) 0.153512259 0.036365828 4.22133 0.00002429
37. B(1,1) 0.962886503 0.009097083 105.84564 0.00000000
38. B(1,2) -0.028205676 0.010179868 -2.77073 0.00559306
39. B(1,3) 0.004078178 0.009093497 0.44847 0.65381265
40. B(2,1) -0.016557174 0.004987052 -3.32003 0.00090007
41. B(2,2) 0.972707541 0.005647346 172.24153 0.00000000
42. B(2,3) -0.004833512 0.004825034 -1.00176 0.31646093
43. B(3,1) 0.035292419 0.008823122 3.99999 0.00006334
44. B(3,2) 0.034450463 0.010279357 3.35142 0.00080398
45. B(3,3) 0.990702221 0.009526221 103.99740 0.00000000
46. Shape 7.307117875 0.584838219 12.49426 0.00000000
Statistic Degrees Signif
353.50 180 0.00000
Multivariate Q(5)= 29.89063
Significance Level as Chi-Squared(45)= 0.95945
Copyright © 2025 Thomas A. Doan