Page 1 of 2

Problem with multivariate GARCH model

Posted: Fri May 02, 2014 3:53 am
by ecofin
hi Tom

Thank you for your explanation. I confirm that I have had a course in literature on multivariate GARCH model.

I have a porbleme convergence in code brooks. When I run the program, it shows me in the output window that the matrix is not invertible.

Code: Select all

linreg DLBMGR10Y_RI / r1s
# constant
compute A0 = %beta(1)
compute VC11 = %seesq

linreg DLBMFR10Y_RI / r2s
# constant
compute B0 = %beta(1)
compute VC12 = %seesq

compute VC12 = (VC11*VC12)**0.5

VCV(noprint,matrix=COVM)
# r1s r2s
compute U11s = COVM(1,1) , U12s = COVM(1,2), U22s = COVM(2,2)


set r1 = r1s
set r2 = r2s
set U11 = U11s
set U12 = U12s
set U22 = U22s

nonlin A0 B0 VC11 VC12 V11 V12 V21 V22 CV11 CV12 CV21
frml H11 = vc11 + v11*u11{1} + v12*r1{1}**2
frml H22 = vc12 + v21*u22{1} + v22*r2{1}**2
frml H12 = cv12 + cv21*u12{1} + cv11*(r1{1}*r2{1})
frml resid1 = DLBMGR10Y_RI - A0
frml resid2 = DLBMFR10Y_RI - B0

compute cv11 = 0.05
compute cv21 = 0.07
**compute cv12 = 0.05
compute v11 = 0.7
compute v12 = 0.05
compute v21 = 0.7
compute v22 = 0.05

dec symm um
dec vect rv
frml toto = (U11(T)=H11(T)),(U12(T)=H12(T)),(U22(T)=H22(T)), $
            (R1(T)= resid1(T)),(R2(T)= resid2(T)), $
            (UM =||U11(T)|U12(T),U22(T)||),(RV =||R1(T),R2(T)||), $
            -.5 * log(%det(UM))-.5 * %QFORM(INV(UM),RV)

nlpar (criterion=value,cvcrit=0.0001,subiters=50)

maximize(method=simplex,iters=15,noprint,trace) toto 1999:04:03  2014:02:21

max(method=BHHH, robust,recursive,iters=100) toto 1999:04:03  2014:02:21
thank you

Re: Problem with multivariate GARCH model

Posted: Fri May 02, 2014 6:32 am
by TomDoan
That's a program which pre-dates the GARCH instruction. Just use

garch / DLBMGR10Y_RI DLBMFR10Y_RI

instead. (That replaces that whole code block from your message). Are your data in yields or are they raw bond prices?

Re: Problem with multivariate GARCH model

Posted: Fri May 02, 2014 7:58 am
by ecofin
it's data yields (RI is the return index)

Is that you have an idea how intoduire the conditional variance in the estimation of a VAR?

Re: Problem with multivariate GARCH model

Posted: Fri May 02, 2014 10:36 am
by TomDoan
What is it that you want added to the VAR? A two variable VAR-GARCH model generates two variances and one covariance. Which of those are going in which equations?

Re: Problem with multivariate GARCH model

Posted: Fri May 02, 2014 4:32 pm
by ecofin
Hi Tom

Sorry for the error sending message. I want to add the two variances in each equation .

once again thank you for your understanding.

Re: Problem with multivariate GARCH model

Posted: Sat May 03, 2014 12:26 pm
by TomDoan
This does a 1 lag VAR with both variances in the mean model. This does the default DVECH multivariate GARCH model. You'll have to decide what the appropriate MV-GARCH model is for the data.

Code: Select all

dec symm[series] hhs(2,2)
clear(zeros) hhs
*
system(model=vargarchm)
variables DLBMGR10Y_RI DLBMFR10Y_RI
lags 1
det constant hhs(1,1) hhs(2,2)
end(system)
*
garch(model=vargarchm,p=1,q=1,pmethod=simplex,piters=10,$
   mvhseries=hhs)

Re: Problem with multivariate GARCH model

Posted: Tue May 06, 2014 3:19 am
by ecofin
TomDoan wrote:This does a 1 lag VAR with both variances in the mean model. This does the default DVECH multivariate GARCH model. You'll have to decide what the appropriate MV-GARCH model is for the data.

Code: Select all

dec symm[series] hhs(2,2)
clear(zeros) hhs
*
system(model=vargarchm)
variables DLBMGR10Y_RI DLBMFR10Y_RI
lags 1
det constant hhs(1,1) hhs(2,2)
end(system)
*
garch(model=vargarchm,p=1,q=1,pmethod=simplex,piters=10,$
   mvhseries=hhs)
Hi Tom

I executed the code but it presents a problem of convergence in the estimation.

MV-GARCH - Estimation by BFGS
NO CONVERGENCE IN 90 ITERATIONS
LAST CRITERION WAS 0.0000000
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Daily(5) Data From 1999:04:05 To 2014:02:21
Usable Observations 3885
Log Likelihood NA

Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. DLBMGR10Y_RI{1} 0.177156 0.005004 35.40591 0.00000000
2. DLBMFR10Y_RI{1} -0.072251 0.005103 -14.15910 0.00000000
3. Constant 0.000551 0.000013 43.51404 0.00000000
4. HHS(1,1) 4.374026 0.039382 111.06695 0.00000000
5. HHS(2,2) -11.281035 0.593100 -19.02045 0.00000000
6. DLBMGR10Y_RI{1} 0.006736 0.000723 9.31861 0.00000000
7. DLBMFR10Y_RI{1} 0.051788 0.000374 138.47293 0.00000000
8. Constant 0.000853 0.000034 25.16654 0.00000000
9. HHS(1,1) -0.085090 0.025590 -3.32508 0.00088394
10. HHS(2,2) -27.464232 2.244722 -12.23502 0.00000000
11. C(1,1) 0.000044 0.000000 942.67765 0.00000000
12. C(2,1) 0.000049 0.000000 647.28444 0.00000000
13. C(2,2) 0.000037 0.000000 828.86853 0.00000000
14. A(1,1) 0.173441 0.001510 114.85136 0.00000000
15. A(2,1) 0.211968 0.001795 118.10882 0.00000000
16. A(2,2) 0.238926 0.002559 93.37182 0.00000000
17. B(1,1) 0.799188 0.000039 20350.80241 0.00000000
18. B(2,1) 0.631050 0.000481 1311.68592 0.00000000
19. B(2,2) 0.527537 0.001395 378.05567 0.00000000


Variables are repeated in the estimation, yes I understand because it is estimated VAR my question is whether the first estimated variables correspond to the estimation of the first equation of the VAR. H (2,2) is the variance of the second input variable in the VAR?
thank you.

Re: Problem with multivariate GARCH model

Posted: Tue May 06, 2014 6:18 am
by ecofin
Hi Tom

en utilisant la specification BEKK dans GARCH on aboutit à la convergence.

comment interpreter ce resultat issu de VAR?

F-Tests, Dependent Variable DLBMGR10Y_RI
Variable F-Statistic Signif
*******************************************************
DLBMGR10Y_RI 132.7475 0.0000000
DLBMIR10Y_RI 3.7916 0.0515830

I know he interpreted as the Granger causality test. But the problem is to know the meaning of interpretation.

Once again thank you Tom

Re: Problem with multivariate GARCH model

Posted: Tue May 06, 2014 7:54 am
by TomDoan
ecofin wrote:
TomDoan wrote:This does a 1 lag VAR with both variances in the mean model. This does the default DVECH multivariate GARCH model. You'll have to decide what the appropriate MV-GARCH model is for the data.

Code: Select all

dec symm[series] hhs(2,2)
clear(zeros) hhs
*
system(model=vargarchm)
variables DLBMGR10Y_RI DLBMFR10Y_RI
lags 1
det constant hhs(1,1) hhs(2,2)
end(system)
*
garch(model=vargarchm,p=1,q=1,pmethod=simplex,piters=10,$
   mvhseries=hhs)
Hi Tom

I executed the code but it presents a problem of convergence in the estimation.

MV-GARCH - Estimation by BFGS
NO CONVERGENCE IN 90 ITERATIONS
LAST CRITERION WAS 0.0000000
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Daily(5) Data From 1999:04:05 To 2014:02:21
Usable Observations 3885
Log Likelihood NA

Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. DLBMGR10Y_RI{1} 0.177156 0.005004 35.40591 0.00000000
2. DLBMFR10Y_RI{1} -0.072251 0.005103 -14.15910 0.00000000
3. Constant 0.000551 0.000013 43.51404 0.00000000
4. HHS(1,1) 4.374026 0.039382 111.06695 0.00000000
5. HHS(2,2) -11.281035 0.593100 -19.02045 0.00000000
6. DLBMGR10Y_RI{1} 0.006736 0.000723 9.31861 0.00000000
7. DLBMFR10Y_RI{1} 0.051788 0.000374 138.47293 0.00000000
8. Constant 0.000853 0.000034 25.16654 0.00000000
9. HHS(1,1) -0.085090 0.025590 -3.32508 0.00088394
10. HHS(2,2) -27.464232 2.244722 -12.23502 0.00000000
11. C(1,1) 0.000044 0.000000 942.67765 0.00000000
12. C(2,1) 0.000049 0.000000 647.28444 0.00000000
13. C(2,2) 0.000037 0.000000 828.86853 0.00000000
14. A(1,1) 0.173441 0.001510 114.85136 0.00000000
15. A(2,1) 0.211968 0.001795 118.10882 0.00000000
16. A(2,2) 0.238926 0.002559 93.37182 0.00000000
17. B(1,1) 0.799188 0.000039 20350.80241 0.00000000
18. B(2,1) 0.631050 0.000481 1311.68592 0.00000000
19. B(2,2) 0.527537 0.001395 378.05567 0.00000000


Variables are repeated in the estimation, yes I understand because it is estimated VAR my question is whether the first estimated variables correspond to the estimation of the first equation of the VAR. H (2,2) is the variance of the second input variable in the VAR?
thank you.
Multiply your two data series by 100 to fix the scale on the C's.

The first five coefficients are for the mean for the first equation, the second five are for the mean in the second equation.

Re: Problem with multivariate GARCH model

Posted: Wed May 21, 2014 8:48 pm
by ddngoh
TOM, I have a problem with the normality assumption. My BEKK and DCC model meets all adequacy tests such as MV ARCH effects and autocorrelation but fails the normality test since p=value of MVJB is 0. Is the model still valid? If yes, how do I interpret it? Thanx

Re: Problem with multivariate GARCH model

Posted: Wed May 21, 2014 10:36 pm
by TomDoan
ddngoh wrote:TOM, I have a problem with the normality assumption. My BEKK and DCC model meets all adequacy tests such as MV ARCH effects and autocorrelation but fails the normality test since p=value of MVJB is 0. Is the model still valid? If yes, how do I interpret it? Thanx
It's valid as a QMLE. You probably want to use the ROBUSTERRORS option on the GARCH instruction to correct the covariance matrix of the estimates. It won't change the parameter estimates or the forecasts but will give you more valid standard errors.

Re: Problem with multivariate GARCH model

Posted: Thu May 22, 2014 6:27 am
by ddngoh
Thank you TOM,

After ready through the ROBUSTERRORS options in the manual could not apply it to my codes: Where and how do I apply it given the codes below?

DATA(FORMAT=DTA,BOTTOM=289,RIGHT=3) 1990:01 2013:12 infl exch inte
set dinfl = 100.0*log(infl/infl{1})
set dexch = 100.0*log(exch/exch{1})
set dinte = 100.0*log(inte/inte{1})
garch(p=1,q=1,mv=dcc,pmethod=simplex,piters=10,hmatrices=hh,rvectors=rd) / dinfl dexch dinte

Re: Problem with multivariate GARCH model

Posted: Thu May 22, 2014 7:07 am
by ddngoh
TOM,
I seem to be getting some results with the following code

garch(robusterrors,p=1,q=1,mv=dcc,pmethod=simplex,piters=10,hmatrices=hh,rvectors=rd) / dinfl dexch dinte

I guess am on the right path?

I will back!

Re: Problem with multivariate GARCH model

Posted: Wed May 28, 2014 4:27 am
by ecofin
TomDoan wrote:This does a 1 lag VAR with both variances in the mean model. This does the default DVECH multivariate GARCH model. You'll have to decide what the appropriate MV-GARCH model is for the data.

Code: Select all

dec symm[series] hhs(2,2)
clear(zeros) hhs
*
system(model=vargarchm)
variables DLBMGR10Y_RI DLBMFR10Y_RI
lags 1
det constant hhs(1,1) hhs(2,2)
end(system)
*
garch(model=vargarchm,p=1,q=1,pmethod=simplex,piters=10,$
   mvhseries=hhs)
hello tom

I come back to the question of convergence of the model. I've used in the multivariate GARCH mv = vech and multiplied by 100 variables, it still poses a problem of convergence.

In your opinion this is due to what?

thank you

Code: Select all

MV-GARCH, VECH - Estimation by BFGS
NO CONVERGENCE IN 200 ITERATIONS
LAST CRITERION WAS  0.0000000
SUBITERATIONS LIMIT EXCEEDED.
ESTIMATION POSSIBLY HAS STALLED OR MACHINE ROUNDOFF IS MAKING FURTHER PROGRESS DIFFICULT
TRY HIGHER SUBITERATIONS LIMIT, TIGHTER CVCRIT, DIFFERENT SETTING FOR EXACTLINE OR ALPHA ON NLPAR
RESTARTING ESTIMATION FROM LAST ESTIMATES OR DIFFERENT INITIAL GUESSES MIGHT ALSO WORK
Daily(5) Data From 1999:04:05 To 2014:02:21
Usable Observations                      3885
Log Likelihood                     -3671.5276

    Variable                        Coeff      Std Error      T-Stat      Signif
************************************************************************************
1.  DLBMGR10Y_RI{1}               0.115780194  0.000163863    706.56709  0.00000000
2.  DLBMFR10Y_RI{1}              -0.131664947  0.011684483    -11.26836  0.00000000
3.  Constant                      0.105509661  0.005426966     19.44174  0.00000000
4.  HHS(1,1)                     -0.040884659  0.000138408   -295.39222  0.00000000
5.  HHS(2,2)                     -0.331586522  0.043997161     -7.53654  0.00000000
6.  DLBMGR10Y_RI{1}               0.053776447  0.000172712    311.36550  0.00000000
7.  DLBMFR10Y_RI{1}              -0.128796334  0.003105876    -41.46860  0.00000000
8.  Constant                      0.105420730  0.002265162     46.54004  0.00000000
9.  HHS(1,1)                     -0.002081159  0.000044879    -46.37221  0.00000000
10. HHS(2,2)                     -0.368597565  0.026028267    -14.16143  0.00000000
11. C(1,1)                       -0.233563432  0.000392006   -595.81567  0.00000000
12. C(2,1)                       -0.010277315  0.000061136   -168.10658  0.00000000
13. C(2,2)                        0.021908032  0.000003240   6761.09424  0.00000000
14. A(1,1)(1)                     0.059340123  0.000003791  15652.79436  0.00000000
15. A(1,1)(2)                    -0.225238935  0.000136065  -1655.37829  0.00000000
16. A(1,1)(3)                     0.230344051  0.001100529    209.30309  0.00000000
17. A(2,1)(1)                    -0.011227541  0.000042107   -266.64022  0.00000000
18. A(2,1)(2)                     0.056685350  0.000004211  13462.74080  0.00000000
19. A(2,1)(3)                     0.014491281  0.000209467     69.18163  0.00000000
20. A(2,2)(1)                     0.007125011  0.000022408    317.96191  0.00000000
21. A(2,2)(2)                    -0.007196022  0.000000342 -21036.01110  0.00000000
22. A(2,2)(3)                     0.035349043  0.000040371    875.59974  0.00000000
23. B(1,1)(1)                     0.391944403  0.000131347   2984.03970  0.00000000
24. B(1,1)(2)                     0.002411306  0.000012877    187.25313  0.00000000
25. B(1,1)(3)                     2.184022603  0.002717704    803.62785  0.00000000
26. B(2,1)(1)                     0.010771110  0.000003808   2828.82831  0.00000000
27. B(2,1)(2)                     0.673389971  0.000196640   3424.47425  0.00000000
28. B(2,1)(3)                     0.328395459  0.000157497   2085.08625  0.00000000
29. B(2,2)(1)                     0.024154363  0.000183147    131.88480  0.00000000
30. B(2,2)(2)                     0.029211630  0.000018147   1609.70696  0.00000000
31. B(2,2)(3)                     0.783234774  0.000015482  50588.69889  0.00000000

Re: Problem with multivariate GARCH model

Posted: Wed May 28, 2014 5:15 am
by TomDoan
That's the output from a model done with MV=VECH. Don't do that. Use one of the more standard MV options.

Have you gotten the model to converge without the "M" terms?