VARMA GARCH Model

Discussions of ARCH, GARCH, and related models
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VARMA GARCH Model

Unread post by TomDoan »

abi wrote:Dear Tom,
Thank you for quick reply. could you please tell me if i want to estimate VARMA model by using quasi maximum likelihood methods, how can i do this? indeed what code is necessary to run QML estimator? should i use MAXIMIZE instruction?
See the thread

http://www.estima.com/forum/viewtopic.php?f=6&t=731
abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

Re: VARMA GARCH Model

Unread post by abi »

Hi Tom,
thank you for guidance. as i know QML involves changing the calculation of the covariance matrix,could you please help me in writing the procedure for QML method.

I highly appreciate your help,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VARMA GARCH Model

Unread post by TomDoan »

abi wrote:Hi Tom,
thank you for guidance. as i know QML involves changing the calculation of the covariance matrix,could you please help me in writing the procedure for QML method.

I highly appreciate your help,
Just add the ROBUSTERRORS option to the estimation instruction.
abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

Re: VARMA GARCH Model

Unread post by abi »

Hi Tom,
can you please tell me how can i get the optimal lags in VARMA(p,q)? may i use the AIC & SBC criteria?

Thanks,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VARMA GARCH Model

Unread post by TomDoan »

abi wrote:Hi Tom,
can you please tell me how can i get the optimal lags in VARMA(p,q)? may i use the AIC & SBC criteria?

Thanks,
Yes. That would be the usual way. However, given that the model gets quite a bit more complicated as you increase the lags, an alternative is to start small and test for remaining serial correlation, and only go to higher orders if necessary. I've seen examples of "VARMA" models where there didn't seem to be any real point to the MA part other than to be different.
abi
Posts: 74
Joined: Sat Apr 13, 2013 3:48 am

Re: VARMA GARCH Model

Unread post by abi »

Dear Tom,
I want to use a VARMA, GARCH-in-Mean, asymmetric BEKK model. In this case i select the optimal values of AR and MA terms equal one (p=s=1) and lag of GARCH term is equal two (q=2). In this way that there is no serial correlation and ARCH effects in the standardized residuals of the model. Is there any theoretically problem in this case (because AR and MA lag term are smaller than GARCH term)?

Regards,
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VARMA GARCH Model

Unread post by TomDoan »

abi wrote:Dear Tom,
I want to use a VARMA, GARCH-in-Mean, asymmetric BEKK model. In this case i select the optimal values of AR and MA terms equal one (p=s=1) and lag of GARCH term is equal two (q=2). In this way that there is no serial correlation and ARCH effects in the standardized residuals of the model. Is there any theoretically problem in this case (because AR and MA lag term are smaller than GARCH term)?

Regards,
No. There's no connection between the two.
hung
Posts: 6
Joined: Tue Aug 05, 2014 11:01 pm

Re: VARMA GARCH Model

Unread post by hung »

Dear Dr Tom Doan
I'm very new with RATs so please help me with the simple question.
I try to estimate bivariate VARMA(1,1)-GARCH-asymmetric BEKK model. However, I got some difficulty reading the report. I'd like to do some Hypotheses testing such as: Diagonal VARMA, no GARCH-M as shown in Rahman and Serletis (2012) (as your mention) but I don't know for sure which are γ and ψ from the output report. Can I have Output Representation from RATs as Eviews?

More over, as you can see the *Ljung-Box Q-statistics of square of standardized residual 1* is significant at 1%. What should I do with the program to have it insignificant?

Best regards,
Hung


Code: Select all

* VARMA(1,1)-BEKK-MGARCH square root model.

OPEN DATA "C:\BasicM.xlsx"
CALENDAR(D) 2000:1:4
Allocate 2014:1:31
DATA(FORMAT=XLSX,ORG=COLUMNS) 2000:1:4 2014:1:31 rbmindo rbmmalay rbmphil rbmsing rbmthai rbmviet rbmus rbmasia
dec vect[series] sqrth(2)
dec vect[series] eps(2)
*
system(model=varmah)
variables rbmindo rbmus
lags 1 1
det constant eps(1){1} eps(2){1} sqrth(1) sqrth(2)
end(system)
*
clear(zeros) sqrth eps
*
* Do three iterations on the VARMA part to get an initial value for the
* covariance matrix.
*
do iters=1,3
   estimate(noprint,resids=resids)
   set eps(1) %regstart() * = resids(1)
   set eps(2) %regstart() * = resids(2)
end do iters
*
compute cv0=%sigma
*
garch(model=varmah,mv=bekk, variances=spillover, asymmetric,$
rvectors=rv,hmatrices=hh,presample=cv0,$
uadjust=%pt(eps,t,rv(t)),hadjust=%pt(sqrth,t,%sqrt(%xdiag(hh(t)))),$
  pmethod=simplex,piters=20)


set z1 = rv(t)(1)/sqrt(hh(t)(1,1))
set z2 = rv(t)(2)/sqrt(hh(t)(2,2))
set z1sq = z1**2
set z2sq = z2**2
@bdindtests z1
@bdindtests z2
dec vect[series] zu(%nvar)
do time=%regstart(),%regend()
compute %pt(zu,time,%solve(%decomp(hh(time)),rv(time)))
end do time

*Ljung-Box Q-statistics of standardized residual 1
@mvqstat(lags=12)
# zu(1)

*Ljung-Box Q-statistics of standardized residual 2
@mvqstat(lags=12)
# zu(2)

*Ljung-Box Q-statistics of square of standardized residual 1
@mvqstat(lags=12)
# z1sq

*Ljung-Box Q-statistics of square of standardized residual 2
@mvqstat(lags=12)
# z2sq
[quote][/quote]
Attachments
BasicM.xlsx
(432.8 KiB) Downloaded 815 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VARMA GARCH Model

Unread post by TomDoan »

hung wrote:Dear Dr Tom Doan
I'm very new with RATs so please help me with the simple question.
I try to estimate bivariate VARMA(1,1)-GARCH-asymmetric BEKK model. However, I got some difficulty reading the report. I'd like to do some Hypotheses testing such as: Diagonal VARMA, no GARCH-M as shown in Rahman and Serletis (2012) (as your mention) but I don't know for sure which are γ and ψ from the output report. Can I have Output Representation from RATs as Eviews?
There's no way to shift a model over to EViews. Besides, you would still have to figure out what you needed to test. Just look at the output and figure out what the coefficient numbers that have to be zeroed out in each hypothesis. The "M" terms, for instance, are 8, 9, 17 and 18, so

test(title="No M Effect",zeros)
# 8 9 17 18

would be a Wald test for that.
hung wrote: More over, as you can see the *Ljung-Box Q-statistics of square of standardized residual 1* is significant at 1%. What should I do with the program to have it insignificant?
If you do the following (@MVQSTAT is really designed for joint tests, not univariate):

@regcorrs(report,number=12) z1sq

you get

Code: Select all

Lag  Corr  Partial   LB Q    Q Signif
  1  0.021   0.021  1.614818    0.2038
  2 -0.027  -0.028  4.316531    0.1155
  3  0.017   0.018  5.328052    0.1493
  4 -0.018  -0.020  6.524790    0.1632
  5  0.029   0.031  9.615696    0.0869
  6 -0.026  -0.029 12.190660    0.0578
  7 -0.028  -0.024 15.072590    0.0351
  8  0.058   0.057 27.531522    0.0006
  9 -0.024  -0.026 29.575046    0.0005
 10  0.023   0.027 31.512272    0.0005
 11  0.001  -0.003 31.516076    0.0009
 12 -0.002   0.004 31.527265    0.0016
As you can see, it's the 8th lag that really makes the statistic significant. There's likely nothing that you can do to fix a problem that causes a blip at lag 8. With 3600+ data points, there's very little chance that you will get a GARCH model to pass all diagnostics at the .05 level. Given that it's fine for the short lags, I wouldn't worry about it.
hung
Posts: 6
Joined: Tue Aug 05, 2014 11:01 pm

Re: VARMA GARCH Model

Unread post by hung »

Dear Dr Thomas Doan
Thank you very much for your reply. But the thing is that I cannot figure out the what estimates comes from what parameters from Rats output. For example the positions: 1,2, 10,11 and 3,4, 12,13 from the below output from VARMA (1,1)- GARCHM-assymetric BEKK (data is the same as my previous attachment).

Moreover, I'd like to have Q^2(12) for the joint standardized residuals but I don't know what is the command. That is the reason I get the z1sq and z2sq to have their Q^2(12) values. But as your comments, this command is for individual series only. Can you tell me the command for the square Q of zu?

Since I'm very new with RATs, I don't know much even the basic thing of RATs. But I need this program for my project so could you please answer this question? (i will invest in RATs later)
If I want to change from VARMA(1,1) to VARMA(1,2), is it correct that I change from: (due to auto correlation problem, if any)

Code: Select all

system(model=varmah)
variables rbmindo rbmus
lags 1 1
det constant eps(1){1} eps(2){1} sqrth(1) sqrth(2)
end(system)
TO

Code: Select all

system(model=varmah)
variables rbmindo rbmus
lags 1 2
det constant eps(1){1} eps(2){1} eps(1){2} eps(2){2} sqrth(1) sqrth(2)
end(system)
Can you suggest me the topic that I can learn to define the output coefficients and their parameters? (since VARMA (1,2) has more variables than VARMA (1,1) and that make me more confuse) or do you have any documents about reading output from this model?

Thank you very much.
Hung

Code: Select all

MV-GARCH, BEKK - Estimation by BFGS
Convergence in   144 Iterations. Final criterion was  0.0000000 <=  0.0000100
Daily(5) Data From 2000:01:05 To 2014:01:31
Usable Observations                      3673
Log Likelihood                    -14117.1307

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  RBMINDO{1}                    0.311383487  0.123336861      2.52466  0.01158107
2.  RBMINDO{1}                    0.345268102  0.123336839      2.79939  0.00511990
3.  RBMUS{1}                      2.273218103  0.492027469      4.62010  0.00000384
4.  RBMUS{1}                      2.338340113  0.492027589      4.75246  0.00000201
5.  Constant                      0.560564252  0.288827317      1.94083  0.05227910
6.  EPS(1){1}                    -0.633765161  0.243799255     -2.59954  0.00933496
7.  EPS(2){1}                    -4.361230660  0.988603479     -4.41151  0.00001027
8.  SQRTH(1)                      0.176945115  0.152684677      1.15889  0.24650004
9.  SQRTH(2)                     -0.803733369  0.244817367     -3.28299  0.00102712
10. RBMINDO{1}                   -0.024388008  0.024668329     -0.98864  0.32284107
11. RBMINDO{1}                    0.034640429  0.024668379      1.40424  0.16024614
12. RBMUS{1}                     -0.126791657  0.132139574     -0.95953  0.33729269
13. RBMUS{1}                     -0.141509938  0.132139575     -1.07091  0.28420873
14. Constant                     -0.144940873  0.082123036     -1.76492  0.07757663
15. EPS(1){1}                    -0.015533750  0.046773251     -0.33211  0.73980805
16. EPS(2){1}                     0.243152151  0.256817926      0.94679  0.34374678
17. SQRTH(1)                     -0.043947712  0.040160976     -1.09429  0.27382826
18. SQRTH(2)                      0.213146403  0.062841602      3.39180  0.00069434
19. C(1,1)                        0.434529472  0.046635270      9.31761  0.00000000
20. C(2,1)                        0.036463757  0.034476537      1.05764  0.29021970
21. C(2,2)                        0.183498895  0.019398861      9.45926  0.00000000
22. A(1,1)                        0.248594174  0.019926473     12.47557  0.00000000
23. A(1,2)                        0.001927515  0.014875560      0.12958  0.89690193
24. A(2,1)                        0.157618868  0.027684019      5.69350  0.00000001
25. A(2,2)                       -0.106060741  0.026567869     -3.99207  0.00006550
26. B(1,1)                        0.908483168  0.012498979     72.68459  0.00000000
27. B(1,2)                       -0.009859188  0.009696187     -1.01681  0.30924340
28. B(2,1)                        0.014282629  0.007899892      1.80795  0.07061391
29. B(2,2)                        0.962616424  0.004448899    216.37182  0.00000000
30. D(1,1)                        0.265637079  0.031578858      8.41186  0.00000000
31. D(1,2)                        0.015432905  0.018213977      0.84731  0.39682174
32. D(2,1)                        0.082562284  0.038128569      2.16537  0.03035971
33. D(2,2)                        0.305978699  0.020761504     14.73779  0.00000000


Independence Tests for Series Z1
Test             Statistic  P-Value
Ljung-Box Q(121)  150.52772     0.0356
McLeod-Li(121)    129.85193     0.2748
Turning Points     -0.16962     0.8653
Difference Sign    -0.85726     0.3913
Rank Test          -0.74547     0.4560


Independence Tests for Series Z2
Test             Statistic  P-Value
Ljung-Box Q(121)  121.32039     0.4747
McLeod-Li(121)    119.83000     0.5130
Turning Points     -0.56105     0.5748
Difference Sign    -1.77167     0.0764
Rank Test           1.84968     0.0644

Multivariate Q(12)=      50.78402
Significance Level as Chi-Squared(48)=       0.36444
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VARMA GARCH Model

Unread post by TomDoan »

hung wrote:Dear Dr Thomas Doan
Thank you very much for your reply. But the thing is that I cannot figure out the what estimates comes from what parameters from Rats output. For example the positions: 1,2, 10,11 and 3,4, 12,13 from the below output from VARMA (1,1)- GARCHM-assymetric BEKK (data is the same as my previous attachment).
The first block of 9 coefficients are for the mean equation for the first dependent variable and the second block of 9 are for the mean equation for the other. EPS(1) is the lagged residual from the first equation, EPS(2) is for the second. SQRTH(1) is the square root of the GARCH variance for the first equation and SQRTH(2) is for the second.
hung wrote: Moreover, I'd like to have Q^2(12) for the joint standardized residuals but I don't know what is the command. That is the reason I get the z1sq and z2sq to have their Q^2(12) values. But as your comments, this command is for individual series only. Can you tell me the command for the square Q of zu?
You apply @MVARCHTEST to the jointly standardized residuals. There really is no direct extension of the McLeod-Li test to multivariate settings.
hung wrote: Since I'm very new with RATs, I don't know much even the basic thing of RATs. But I need this program for my project so could you please answer this question? (i will invest in RATs later)
If I want to change from VARMA(1,1) to VARMA(1,2), is it correct that I change from: (due to auto correlation problem, if any)

Code: Select all

system(model=varmah)
variables rbmindo rbmus
lags 1 1
det constant eps(1){1} eps(2){1} sqrth(1) sqrth(2)
end(system)
TO

Code: Select all

system(model=varmah)
variables rbmindo rbmus
lags 1 2
det constant eps(1){1} eps(2){1} eps(1){2} eps(2){2} sqrth(1) sqrth(2)
end(system)
That would be a VARMA(2,2), not a VARMA(1,2). Just lags 1 rather than 1 2 if you want VARMA(1,2). However, it's generally better to keep the MA polynomial short if possible. If you need more lags of something, I would try the VARMA(2,1) before VARMA(1,2) (which just requires changing the LAGS instruction to lags 1 2 in the VAR).
hung wrote: Can you suggest me the topic that I can learn to define the output coefficients and their parameters? (since VARMA (1,2) has more variables than VARMA (1,1) and that make me more confuse) or do you have any documents about reading output from this model?
It's a relatively new paper and so far as I can tell, this is the only thread that really addresses it.
hung
Posts: 6
Joined: Tue Aug 05, 2014 11:01 pm

Re: VARMA GARCH Model

Unread post by hung »

Dear Dr Thomas Doan
Thank you very much for your detail explanations.
More about the VARMA(1,1), VARMA(2,1), VARMA(1,2) and VARMA(2,2). How should I change EPS and SQRTH in these commands :

Code: Select all

det constant eps(1){1} eps(2){1} sqrth(1) sqrth(2)
OR

Code: Select all

det constant eps(1){1} eps(2){1} eps(1){2} eps(2){2} sqrth(1) sqrth(2)
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VARMA GARCH Model

Unread post by TomDoan »

The first is for 1 MA, the second is for 2 MA's. The AR part is handled using the LAGS instruction.
hung
Posts: 6
Joined: Tue Aug 05, 2014 11:01 pm

Re: VARMA GARCH Model

Unread post by hung »

Dear Dr Thomas Doan
Thank you very much. Could you please tell me the commands to get the Mean and Variance values of standardized residuals z1 and z2 and their p_values?

Code: Select all

* VARMA-MGARCH-asymmetry BEKK model.

OPEN DATA "C:\BasicM.xlsx"
CALENDAR(D) 2000:1:4
Allocate 2014:1:31
DATA(FORMAT=XLSX,ORG=COLUMNS) 2000:1:4 2014:1:31 rbmindo rbmmalay rbmphil rbmsing rbmthai rbmviet rbmus rbmasia
dec vect[series] sqrth(2)
dec vect[series] eps(2)


* VARMA (1,1)
system(model=varmah)
variables rbmindo rbmus
lags 1
det constant eps(1){1} eps(2){1} sqrth(1) sqrth(2)
end(system)

clear(zeros) sqrth eps
*
* Do three iterations on the VARMA part to get an initial value for the
* covariance matrix.
*
do iters=1,3
   estimate(noprint,resids=resids)
   set eps(1) %regstart() * = resids(1)
   set eps(2) %regstart() * = resids(2)
end do iters
*
compute cv0=%sigma
*
garch(model=varmah,mv=bekk, variances=spillover, asymmetric,$
rvectors=rv,hmatrices=hh,presample=cv0,$
uadjust=%pt(eps,t,rv(t)),hadjust=%pt(sqrth,t,%sqrt(%xdiag(hh(t)))),$
  pmethod=simplex,piters=20)


set z1 = rv(t)(1)/sqrt(hh(t)(1,1))
set z2 = rv(t)(2)/sqrt(hh(t)(2,2))
set z1sq = z1**2
set z2sq = z2**2
@bdindtests z1
@bdindtests z2
dec vect[series] zu(%nvar)
do time=%regstart(),%regend()
compute %pt(zu,time,%solve(%decomp(hh(time)),rv(time)))
end do time

*Ljung-Box Q-statistics of joint standardized residual
@mvqstat(lags=12)
# zu

*Ljung-Box Q-statistics of square of joint standardized residuals
@mvarchtest (lags=12)
#zu
Best regards,
Hung
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: VARMA GARCH Model

Unread post by TomDoan »

Unless I'm not understanding you, wouldn't that just be the STATISTICS instruction? However, those will be (by construction) very close to mean 0 and variance 1 (not exactly, but fairly close), so I'm not sure why you want to do that.
Post Reply