M-GARCH-M in GARCH Wizard

Discussions of ARCH, GARCH, and related models

M-GARCH-M in GARCH Wizard

Postby PERRY » Sat Jul 30, 2011 6:37 pm

Hello,

How can I estimate a multivariate GARCH in the mean model within the GARCH Wizard?
PERRY
 
Posts: 11
Joined: Thu Mar 08, 2007 9:50 am

Re: M-GARCH-M in GARCH Wizard

Postby PERRY » Sun Jul 31, 2011 7:47 pm

I tried to follow the manual and wrote this code but it does not work I get the message:

Image

Uploaded with ImageShack.us
PERRY
 
Posts: 11
Joined: Thu Mar 08, 2007 9:50 am

Re: M-GARCH-M in GARCH Wizard

Postby moderator » Tue Aug 02, 2011 9:29 am

I don't think you can do that using the Wizard, at least currently. You need to define the equations, GROUP them into a MODEL, and supply that via the MODEL option. See page 301 of the RATS 8 User's Guide for details.

Regards,
Tom Maycock
Estima
moderator
Site Admin
 
Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm

Re: M-GARCH-M in GARCH Wizard

Postby PERRY » Tue Aug 02, 2011 11:26 am

Thank you Tom.

I was hopping to avoid that as I am new to RATS programming and I had already read page UG301 and I came up with the program

Code: Select all
CALENDAR(M) 1973:11
OPEN DATA "C:\Users\User\Desktop\110722 Energy RATS\dataus.txt"
DATA(FORMAT=PRN,NOLABELS,ORG=COLUMNS,TOP=2,RIGHT=3) 1973:11 2007:10 DATES OIL IPI


/* PRE-ESTIMATION */

dec symm[series] hhs(2,2)
clear(zeros) hhs
equation oileq oil
# constant hhs(1,1) hhs(1,2)
equation ipieq ipi
# constant hhs(2,1) hhs(2,2)

group garchm oileq ipieq
garch(model=garchm,p=1,q=1,pmethod=simplex,piters=10,$
mvhseries=hhs)


/* ESTIMATION OF THE M-GARCH-M */


GARCH(P=1,Q=1,MV=BEKK,REGRESSORS) / OIL IPI
# Constant OIL IPI HHS(1,1) HHS(2,1) HHS(2,2)
PERRY
 
Posts: 11
Joined: Thu Mar 08, 2007 9:50 am

Re: M-GARCH-M in GARCH Wizard

Postby TomDoan » Tue Aug 02, 2011 12:47 pm

The first of the two looks correct. Generally, you only include the "own" covariances in the mean model. The second one clearly is incorrect, because you're including current OIL in the equations---perhaps you mean OIL{1} which would put the lagged value in.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: M-GARCH-M in GARCH Wizard

Postby PERRY » Tue Aug 02, 2011 12:55 pm

Running the above program I get the following output:

Code: Select all
MV-GARCH, BEKK - Estimation by BFGS
Convergence in   159 Iterations. Final criterion was  0.0000000 <=  0.0000100
Monthly Data From 1973:11 To 2007:10
Usable Observations                                                                                      408
Log Likelihood                                                                                     2090.6861

    Variable                                                                                       Coeff      Std Error      T-Stat      Signif
***************************************************************************************************************************************************
1.  Constant                                                                                    -4.0560e-003  7.6905e-004     -5.27400  0.00000013
2.  OIL                                                                                              -0.6627       0.0960     -6.90462  0.00000000
3.  IPI                                                                                               0.0000       0.0000      0.00000  0.00000000
4.  HHS(1,1)                                                                                          0.0000       0.0000      0.00000  0.00000000
5.  HHS(2,1)                                                                                          0.0000       0.0000      0.00000  0.00000000
6.  HHS(2,2)                                                                                          0.0000       0.0000      0.00000  0.00000000
7.  ¾OYÃ\݇?øzøÂÚf»>nŸ)ÝHL¿Ã„Ô¤ô²¼?Ðõá0¼>{Õ¾të±?8ÄhL®~¿àÊNŸŠ
U¾Ð¼—šµÔe¾d ÂgÇ|B¾ç‘Àtš—5¿~` -4.9031e+238       0.0000      0.00000  0.00000000
8.  Ðõá0¼>{Õ¾të±?8ÄhL®~¿àÊNŸŠ
U¾Ð¼—šµÔe¾d ÂgÇ|B¾ç‘Àtš—5¿~`                                     4203.2627       0.0000      0.00000  0.00000000
9.  ¼—šµÔe¾d ÂgÇ|B¾ç‘Àtš—5¿~`                                                                         0.0000       0.0000      0.00000  0.00000000
10. ó–qýì>ð`nŽ}k=?§"=N÷ªì?åv>ÔÖâ¾Š·øbn¼?]˜9,Þ­Ô?>y*è…¦¾o•¤að„¾ê"£|P‡>&}ð(Í?5¿ˆÍžjc          36793.2891       0.0000      0.00000  0.00000000
11. øbn¼?]˜9,Þ­Ô?>y*è…¦¾o•¤að„¾ê"£|P‡>&}ð(Í?5¿ˆÍžjc                                          1.1731e+021       0.0000      0.00000  0.00000000
12. P‡>&}ð(Í?5¿ˆÍžjc                                                                          -2.5677e+045       0.0000      0.00000  0.00000000
13. C(1,1)                                                                                      -7.2427e-003  1.7902e-003     -4.04579  0.00005215
14. C(2,1)                                                                                      -8.8975e-005  1.6438e-003     -0.05413  0.95683315
15. C(2,2)                                                                                       2.8661e-006  4.9067e-003 5.84128e-004  0.99953393
16. A(1,1)                                                                                           -0.8041       0.1463     -5.49438  0.00000004
17. A(1,2)                                                                                           -0.2136       0.1126     -1.89697  0.05783225
18. A(2,1)                                                                                            0.2031       0.2289      0.88734  0.37489799
19. A(2,2)                                                                                           -0.3593       0.1668     -2.15351  0.03127829
20. B(1,1)                                                                                            1.2237       0.2725      4.49011  0.00000712
21. B(1,2)                                                                                            1.1514       0.1842      6.25248  0.00000000
22. B(2,1)                                                                                           -0.6243       0.4439     -1.40662  0.15953878
23. B(2,2)                                                                                           -0.9113       0.2513     -3.62565  0.00028824
PERRY
 
Posts: 11
Joined: Thu Mar 08, 2007 9:50 am

Re: M-GARCH-M in GARCH Wizard

Postby TomDoan » Tue Aug 02, 2011 2:35 pm

PERRY wrote:Running the above program I get the following output:

Code: Select all
MV-GARCH, BEKK - Estimation by BFGS
Convergence in   159 Iterations. Final criterion was  0.0000000 <=  0.0000100
Monthly Data From 1973:11 To 2007:10
Usable Observations                                                                                      408
Log Likelihood                                                                                     2090.6861

    Variable                                                                                       Coeff      Std Error      T-Stat      Signif
***************************************************************************************************************************************************
1.  Constant                                                                                    -4.0560e-003  7.6905e-004     -5.27400  0.00000013
2.  OIL                                                                                              -0.6627       0.0960     -6.90462  0.00000000
3.  IPI                                                                                               0.0000       0.0000      0.00000  0.00000000
4.  HHS(1,1)                                                                                          0.0000       0.0000      0.00000  0.00000000
5.  HHS(2,1)                                                                                          0.0000       0.0000      0.00000  0.00000000
6.  HHS(2,2)                                                                                          0.0000       0.0000      0.00000  0.00000000
7.  ¾OYÃ\݇?øzøÂÚf»>nŸ)ÝHL¿Ã„Ô¤ô²¼?Ðõá0¼>{Õ¾të±?8ÄhL®~¿àÊNŸŠ
U¾Ð¼—šµÔe¾d ÂgÇ|B¾ç‘Àtš—5¿~` -4.9031e+238       0.0000      0.00000  0.00000000
8.  Ðõá0¼>{Õ¾të±?8ÄhL®~¿àÊNŸŠ
U¾Ð¼—šµÔe¾d ÂgÇ|B¾ç‘Àtš—5¿~`                                     4203.2627       0.0000      0.00000  0.00000000
9.  ¼—šµÔe¾d ÂgÇ|B¾ç‘Àtš—5¿~`                                                                         0.0000       0.0000      0.00000  0.00000000
10. ó–qýì>ð`nŽ}k=?§"=N÷ªì?åv>ÔÖâ¾Š·øbn¼?]˜9,Þ­Ô?>y*è…¦¾o•¤að„¾ê"£|P‡>&}ð(Í?5¿ˆÍžjc          36793.2891       0.0000      0.00000  0.00000000
11. øbn¼?]˜9,Þ­Ô?>y*è…¦¾o•¤að„¾ê"£|P‡>&}ð(Í?5¿ˆÍžjc                                          1.1731e+021       0.0000      0.00000  0.00000000
12. P‡>&}ð(Í?5¿ˆÍžjc                                                                          -2.5677e+045       0.0000      0.00000  0.00000000
13. C(1,1)                                                                                      -7.2427e-003  1.7902e-003     -4.04579  0.00005215
14. C(2,1)                                                                                      -8.8975e-005  1.6438e-003     -0.05413  0.95683315
15. C(2,2)                                                                                       2.8661e-006  4.9067e-003 5.84128e-004  0.99953393
16. A(1,1)                                                                                           -0.8041       0.1463     -5.49438  0.00000004
17. A(1,2)                                                                                           -0.2136       0.1126     -1.89697  0.05783225
18. A(2,1)                                                                                            0.2031       0.2289      0.88734  0.37489799
19. A(2,2)                                                                                           -0.3593       0.1668     -2.15351  0.03127829
20. B(1,1)                                                                                            1.2237       0.2725      4.49011  0.00000712
21. B(1,2)                                                                                            1.1514       0.1842      6.25248  0.00000000
22. B(2,1)                                                                                           -0.6243       0.4439     -1.40662  0.15953878
23. B(2,2)                                                                                           -0.9113       0.2513     -3.62565  0.00028824


That's out of the second GARCH instruction, which isn't properly formed. The REGRESSORS option was never really designed to work on a multivariate model; instead, you need to use the MODEL option, as is done in your first GARCH.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: M-GARCH-M in GARCH Wizard

Postby PERRY » Wed Aug 03, 2011 1:46 pm

TomDoan wrote:The first of the two looks correct. Generally, you

only include the "own" covariances in the mean model. The second one

clearly is incorrect, because you're including current OIL in the

equations---perhaps you mean OIL{1} which would put the lagged value

in.


Tom thank you again for all the help, I really appreciate it.

The program I posted is my impression from page UG301 of how I should

structure a M-GARCH-M. I thought both the first two as you mention and

the last part are needed to estimate the M-GARCH-M for the multivariate

system OIL, IPI.

Regarding the inclusion of the contemporaneous OIL and IPI I did not

notice it was not lagged.
PERRY
 
Posts: 11
Joined: Thu Mar 08, 2007 9:50 am

Re: M-GARCH-M in GARCH Wizard

Postby PERRY » Wed Aug 03, 2011 2:01 pm

Here is how I modified the code based on the above:

Code: Select all
CALENDAR(M) 1973:11
OPEN DATA "C:\Users\User\Desktop\110722 Energy RATS\dataus.txt"
DATA(FORMAT=PRN,NOLABELS,ORG=COLUMNS,TOP=2,RIGHT=3) 1973:11 2007:10

DATES OIL IPI


I assume that with the following I manage to create a matrix that will store the initial values and then the actual values for the conditional variances and covariances.

Code: Select all
dec symm[series] hhs(2,2)
clear(zeros) hhs


Below I define the two equations that I need for the M-GARCH-M I want to estimate.
I still do not understand how RATS will associate hhs(i,j) with the conditional variances/covariances. It looks like the mean equation of a multivariate GARCH in-the-mean model without any other than the constant and the conditional variances explanatory variables but still hhs(i,j) are not associated with anything...

Code: Select all
equation oileq oil
# constant hhs(1,1) hhs(1,2) hhs(2,1) hhs(2,2)
equation ipieq ipi
# constant hhs(1,1) hhs(1,2) hhs(2,1) hhs(2,2)


Next we group the equations into a model labeled "garchm" as you advised:

Code: Select all
group garchm oileq ipieq


Finally in the last part of the program we instruct RATS to perform a GARCH(1,1) estimation using the "garchm" model, BEKK specification, preliminary estimation using simplex with 10 iterations.

Code: Select all
garch(model=garchm,p=1,q=1,mv=BEKK,pmethod=simplex,piters=10,$
mvhseries=hhs)


Is the following the part where RATS stores the conditional variances/covariances in the hss matrix?

Code: Select all
mvhseries=hhs


That is it? sorry for being so analytical but I am trying to understand the logic. I have been told RATS is very powerful and want to be able to use it for more than standard programs.

Thank you in advance Tom...!!!
PERRY
 
Posts: 11
Joined: Thu Mar 08, 2007 9:50 am

Re: M-GARCH-M in GARCH Wizard

Postby moderator » Wed Aug 03, 2011 2:21 pm

PERRY wrote:Is the following the part where RATS stores the conditional variances/covariances in the hss matrix?

Code: Select all
mvhseries=hhs



Yes. The key is to refer to the same variable name on both the MVHSERIES option and in your equations.

Regards,
Tom Maycock
Estima
moderator
Site Admin
 
Posts: 306
Joined: Thu Oct 19, 2006 4:33 pm

Re: M-GARCH-M in GARCH Wizard

Postby PERRY » Fri Aug 05, 2011 8:26 am

OK now I run the program:

Code: Select all
CALENDAR(M) 1973:11
OPEN DATA "C:\Users\User\Desktop\110722 Energy RATS\dataus.txt"
DATA(FORMAT=PRN,NOLABELS,ORG=COLUMNS,TOP=2,RIGHT=3) 1973:11 2007:10 DATES OIL IPI

/* PRE-ESTIMATION */

dec symm[series] hhs(2,2)
clear(zeros) hhs
equation oileq oil
# constant hhs(1,1) hhs(1,2) hhs(2,1) hhs(2,2)
equation ipieq ipi
# constant hhs(1,1) hhs(1,2) hhs(2,1) hhs(2,2)

group garchm oileq ipieq
garch(model=garchm,p=1,q=1,mv=BEKK,pmethod=simplex,piters=10,$
mvhseries=hhs)


And I got these results:

Code: Select all

MV-GARCH, BEKK - Estimation by BFGS
Convergence in    49 Iterations. Final criterion was  0.0000045 <=  0.0000100
Monthly Data From 1973:11 To 2007:10
Usable Observations                       408
Log Likelihood                      2106.4402

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  Constant                        0.0030665    0.0063040      0.48644  0.62665755
2.  HHS(1,1)                        2.7241851    1.2881911      2.11474  0.03445239
3.  HHS(2,1)                      -58.0674533   21.4759674     -2.70383  0.00685445
4.  HHS(2,1)                      -57.7541027   21.4759760     -2.68924  0.00716144
5.  HHS(2,2)                     -160.8529558   95.2018502     -1.68960  0.09110469
6.  Constant                        0.0043623    0.0013002      3.35503  0.00079358
7.  HHS(1,1)                       -0.0427378    0.0812831     -0.52579  0.59903456
8.  HHS(2,1)                       -1.9714207    1.7100354     -1.15285  0.24897043
9.  HHS(2,1)                       -1.9022851    1.7100860     -1.11239  0.26596986
10. HHS(2,2)                      -20.9218211   20.8896361     -1.00154  0.31656546
11. C(1,1)                          0.0079456    0.0014138      5.61989  0.00000002
12. C(2,1)                          0.0000917    0.0012644      0.07249  0.94221068
13. C(2,2)                          0.0028532    0.0013020      2.19145  0.02841922
14. A(1,1)                          0.6897016    0.0710530      9.70686  0.00000000
15. A(1,2)                          0.0157191    0.0068716      2.28756  0.02216303
16. A(2,1)                         -0.0791518    0.3584136     -0.22084  0.82521761
17. A(2,2)                          0.4041140    0.1105482      3.65555  0.00025663
18. B(1,1)                          0.8050431    0.0306167     26.29421  0.00000000
19. B(1,2)                         -0.0058133    0.0051301     -1.13319  0.25713322
20. B(2,1)                         -0.1306640    0.3039599     -0.42987  0.66728833
21. B(2,2)                          0.7970205    0.1404967      5.67288  0.00000001


My main interest in doing this is to see how the conditional variance of OIL affects the mean equation of the IPI.

To make sure I am reading the output correctly, coefficients 1-5 are for the mean equation of OIL and 6-10 for the mean equation for IPI.
Also, 5-21 are for the conditional variances covariances.

They way it is constructed, what is the coefficient I am looking for? It must be coefficient #7 as OIL is the first variable and equation defined and IPI is the second so that
coefficient #7 gives the effect of the conditional variance of OIL in the IPI mean equation.

Am I right?

Thank you so much!
PERRY
 
Posts: 11
Joined: Thu Mar 08, 2007 9:50 am

Re: M-GARCH-M in GARCH Wizard

Postby TomDoan » Mon Aug 08, 2011 2:08 pm

Because of symmetry H(2,1) and H(1,2) are the same, so you should leave one out of the regressor list. As you have this set up, yes, the effect of the variance of oil on the mean of IP is coefficient 7.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to ARCH and GARCH Models

Who is online

Users browsing this forum: No registered users and 1 guest