Page 1 of 2
Standard BEKK & Triangular BEKK
Posted: Sat Sep 06, 2014 6:53 am
by econo
Dear Friends;
I am trying to run BEKK (std) , BEKK (diag. ) models for log-return o & H index.
So I run this code in RATS 8.0 for
BEKK (std):
Code: Select all
open data Y1_O_A.xls
data(format=xls,org=columns) / O A
compute gstart=2,gend=2276
garch(p=1,q=1,mv=bekk,pmethod=simplex,piters=5,hmatrices=bekkhh, rvectors=bekkrv) gstart gend O A
I got this result :
Code: Select all
MV-GARCH, BEKK - Estimation by BFGS
Log Likelihood 12215.6569
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(1) 0.000283340 0.000400013 0.70833 0.47874139
2. Mean(2) 0.000664793 0.000280385 2.37100 0.01774018
3. C(1,1) 0.002027994 0.000343817 5.89846 0.00000000
4. C(2,1) -0.000395421 0.000278227 -1.42122 0.15525376
5. C(2,2) -0.000296307 0.000793017 -0.37365 0.70866801
6. A(1,1) 0.207104417 0.016768757 12.35061 0.00000000
7. A(1,2) -0.045891094 0.010128710 -4.53079 0.00000588
8. A(2,1) 0.032267832 0.023867324 1.35197 0.17638590
9. A(2,2) 0.210708054 0.015582838 13.52180 0.00000000
10. B(1,1) 0.973169654 0.004569885 212.95277 0.00000000
11. B(1,2) 0.011234222 0.003081176 3.64608 0.00026627
12. B(2,1) -0.004411685 0.005757129 -0.76630 0.44349814
13. B(2,2) 0.975466541 0.003366010 289.79906 0.00000000
Now, I have these questions and appreciate if somebody can help
1. How can I get AIC criteria?
2. how can I get conditional correlations? (to plot the graph, and export it as jpg/png ) (I know that I should use
hmatrices and
rvectors , so I assigned a variable to them in the models but dont know how to do next steps!)
3. in the original paper, the are using triangular BEKK , is there any trick to convert std. to triangular?
I tried to use this code( which is introduced by Mr.TOM here
http://www.estima.com/forum/viewtopic.php?f=11&t=495) Then I failed!

:
Code: Select all
compute n=2
dec packed vat(n,n) vbt(n,n)
dec packed vct(n,n)
dec rect var(n,n) vbr(n,n)
compute vat=sqrt(.05)*%identity(n),vbt=sqrt(.45)*%identity(n)
compute vct=%decomp(rr)
nonlin(parmset=tbekkparms) vct vat vbt
FUNCTION %%TBEKKInit
local integer i j
compute vcs=%ltouterxx(vct)
ewise vbr(i,j)=%if(j>=i,vbt(i,j),0.0)
ewise var(i,j)=%if(j>=i,vat(i,j),0.0)
END
frml hf = vcs+%mqform(h{1},vbr)+%mqform(uu{1},var)
maximize(title="Triangular BEKK",start=%%TBEKKInit(),parmset=meanparms+tbekkparms,$
method=bfgs,iters=400,pmethod=simplex,piters=5) logl gstart gend
because : rr is not introduced! ( actually in that code it is for initial setup parameters for MAXIMIZE code)
4.Then what is C in the table 6 first colmn.?
5.is Mean (1) the same as AR ?
6.is mean (2) the same as MA?
thanks in advance.
Re: stand. BEKK & Trigonal. BEKK
Posted: Sat Sep 06, 2014 10:54 am
by TomDoan
omid_ie wrote:Dear Friends;
I am trying to run BEKK (std) , BEKK (diag. ) models for log-return oil prices & HS300 index. (bi-variate) according to table 6 of Prof. McAleer and Prof. Chang paper:
http://ideas.repec.org/p/kyo/wpaper/743.html
So I run this code in RATS 8.0 for
BEKK (std):
Code: Select all
open data Y1_O_A.xls
data(format=xls,org=columns) / O A
compute gstart=2,gend=2276
garch(p=1,q=1,mv=bekk,pmethod=simplex,piters=5,hmatrices=bekkhh, rvectors=bekkrv) gstart gend O A
I got this result :
Code: Select all
MV-GARCH, BEKK - Estimation by BFGS
Log Likelihood 12215.6569
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. Mean(1) 0.000283340 0.000400013 0.70833 0.47874139
2. Mean(2) 0.000664793 0.000280385 2.37100 0.01774018
3. C(1,1) 0.002027994 0.000343817 5.89846 0.00000000
4. C(2,1) -0.000395421 0.000278227 -1.42122 0.15525376
5. C(2,2) -0.000296307 0.000793017 -0.37365 0.70866801
6. A(1,1) 0.207104417 0.016768757 12.35061 0.00000000
7. A(1,2) -0.045891094 0.010128710 -4.53079 0.00000588
8. A(2,1) 0.032267832 0.023867324 1.35197 0.17638590
9. A(2,2) 0.210708054 0.015582838 13.52180 0.00000000
10. B(1,1) 0.973169654 0.004569885 212.95277 0.00000000
11. B(1,2) 0.011234222 0.003081176 3.64608 0.00026627
12. B(2,1) -0.004411685 0.005757129 -0.76630 0.44349814
13. B(2,2) 0.975466541 0.003366010 289.79906 0.00000000
Now, I have these questions and appreciate if somebody can help
1. How can I get AIC criteria?
@regcrits works for any estimation which generates a log likelihood.
omid_ie wrote:
2. how can I get conditional correlations? (to plot the graph, and export it as jpg/png ) (I know that I should use hmatrices and rvectors , so I assigned a variable to them in the models but dont know how to do next steps!)
set ccorr %regstart() %regend() = %cvtocorr(bekkhh)(1,2)
graph(other options)
# ccorr
You can't directly go to JPG or PNG. Use WMF or EPS to get it into another program first (though if your target can take EPS, it's generally better to do that).
omid_ie wrote:
3. in the original paper, the are using triangular BEKK , is there any trick to convert std. to triangular?
I tried to use this code( which is introduced by Mr.TOM here
http://www.estima.com/forum/viewtopic.php?f=11&t=495) Then I failed!

:
Code: Select all
compute n=2
dec packed vat(n,n) vbt(n,n)
dec packed vct(n,n)
dec rect var(n,n) vbr(n,n)
compute vat=sqrt(.05)*%identity(n),vbt=sqrt(.45)*%identity(n)
compute vct=%decomp(rr)
nonlin(parmset=tbekkparms) vct vat vbt
FUNCTION %%TBEKKInit
local integer i j
compute vcs=%ltouterxx(vct)
ewise vbr(i,j)=%if(j>=i,vbt(i,j),0.0)
ewise var(i,j)=%if(j>=i,vat(i,j),0.0)
END
frml hf = vcs+%mqform(h{1},vbr)+%mqform(uu{1},var)
maximize(title="Triangular BEKK",start=%%TBEKKInit(),parmset=meanparms+tbekkparms,$
method=bfgs,iters=400,pmethod=simplex,piters=5) logl gstart gend
because : rr is not introduced! ( actually in that code it is for initial setup parameters for MAXIMIZE code)
TBEKK and DBEKK were added to the GARCH instruction with 8.2. RR is defined earlier in that program. It's the covariance matrix of the original data.
omid_ie wrote:
4.Then what is C in the table 6 first colmn.?
5.is Mean (1) the same as AR ?
6.is mean (2) the same as MA?
You're not estimating an ARMA model for the mean, just constants. The C's would correspond to mean(1) and mean(2). Note that Table 6 in the paper is for DCC, not BEKK.
While they are using ARMA(1,1) mean models, I don't like the looks of their ARMA estimates---they show every sign of cancellation problems which means you don't need either.
Re: stand. BEKK & Trigonal. BEKK
Posted: Sat Sep 06, 2014 11:27 am
by econo
Thanks a lot for your kind response.
This code is not working as I am using version RATS 8.0
This is the Error :
Code: Select all
## OP3. This Instruction Does Not Have An Option OTH
>>>>graph(other <<<<
You are right. In their Table 7. (BEKK model) , They are using ARMA mean triangular (? the BOLD C matrix is triangular) BEKK.
So, How can I apply this in RATS?
Re: stand. BEKK & Trigonal. BEKK
Posted: Sat Sep 06, 2014 12:57 pm
by TomDoan
"other options" means whatever options (header, footer, ...) you want.
If you want to do TBEKK with the RATS 8.0, you need to use the MAXIMIZE code that you were showing earlier. You just need to make sure you get all the setup code.
Re: stand. BEKK & Trigonal. BEKK
Posted: Tue Oct 28, 2014 4:14 pm
by econo
In standard BEKK Results of this Code:
garch(p=1,q=1,mv=bekk,pmethod=simplex,piters=5)
I can get the A,B, C matrices
Also I got mean (1) ,mean(2) coefficients.
Can somebody show me the MEAN Equation ?
is it :
y_t=μ_t+ε_t
Re: stand. BEKK & Trigonal. BEKK
Posted: Tue Oct 28, 2014 6:57 pm
by TomDoan
1. Mean(1) 0.000283340 0.000400013 0.70833 0.47874139
2. Mean(2) 0.000664793 0.000280385 2.37100 0.01774018
mu for the first element of y is 0.000283340 and mu for the second is 0.000664793. The mu's aren't time-varying.
Re: stand. BEKK & Trigonal. BEKK
Posted: Sun Dec 21, 2014 5:36 am
by econo
How can I calculate n(t) from this formula?
ε_t=H_t^(1/2) η_t
Also How can I export ε_t and H_t to the CSV format?
Re: stand. BEKK & Trigonal. BEKK
Posted: Sun Dec 21, 2014 11:14 pm
by TomDoan
Those are multivariate standardized residuals, as described in the User's Guide. Note that there are different sets depending upon which "square root" of H you choose.
You can use the MVHSERIES option to get the H broken into separate series for each component. Use RVECTORS and use SET instructions to break the raw residuals down. Once you have them in series, you can use COPY.
Re: stand. BEKK & Trigonal. BEKK
Posted: Thu Dec 25, 2014 7:13 am
by econo
Dear Tom;
I used this code:
Code: Select all
open data Main.xls
data(format=xls,org=columns) / O S
compute gstart=2,gend=2300
garch(p=1,q=1,mv=bekk,pmethod=simplex,piters=5,hmatrices=bekkhh, MVHSERIES=bekkHmatrix, rvectors=bekkrv) gstart gend O S
set ccorr %regstart() %regend() = %cvtocorr(bekkhh)(1,2)
open copy x12.xls
copy(data,format=xls,org=columns) /bekkHmatrix
open copy x11.xls
copy(data,format=xls,org=columns) /bekkrv
Now, I think these are my variables:
1. bekkHmatrix is H(t) {variance-covariance Matrix)
2. ccorr is Conditional correlations (?? is this true? maybe it is covariance of HMATRICES not correlation? )
*the help of RATS says:
Note that HMATRICES and MVHSERIES save the same information, just in different variable types.
but as I am checking my ccorr and bekkHmatrix(2,1) are not the same!
3. bekkrv is supposed to give me residuals. (but gives me error!!- I am sure I should use SET, but couldnt figure it out !)
also whats is STDRESIDS option? what this gives me and has difference with rvectors.
Best Regards
and thank a lot in advance.
Re: stand. BEKK & Trigonal. BEKK
Posted: Thu Dec 25, 2014 11:28 am
by TomDoan
omid_ie wrote:Dear Tom;
I used this code:
Code: Select all
open data Main.xls
data(format=xls,org=columns) / Opec Shenzen
compute gstart=2,gend=2354
garch(p=1,q=1,mv=bekk,pmethod=simplex,piters=5,hmatrices=bekkhh, MVHSERIES=bekkHmatrix, rvectors=bekkrv) gstart gend Opec Shenzen
set ccorr %regstart() %regend() = %cvtocorr(bekkhh)(1,2)
open copy x12.xls
copy(data,format=xls,org=columns) /bekkHmatrix
open copy x11.xls
copy(data,format=xls,org=columns) /bekkrv
Now, I think these are my variables:
1. bekkHmatrix is H(t) {variance-covariance Matrix)
Correct
omid_ie wrote:
2. ccorr is Conditional correlations (?? is this true? maybe it is covariance of HMATRICES not correlation? )
It's the conditional correlation.
omid_ie wrote:
*the help of RATS says:
Note that HMATRICES and MVHSERIES save the same information, just in different variable types.
but as I am checking my ccorr and bekkHmatrix(2,1) are not the same!
One's the correlation, one the covariance so they shouldn't be the same.
omid_ie wrote:
3. bekkrv is supposed to give me residuals. (but gives me error!!- I am sure I should use SET, but couldnt figure it out !)
set r1 = bekkrv(t)(1)
set r2 = bekkrv(t)(2)
omid_ie wrote:
also whats is STDRESIDS option? what this gives me and has difference with rvectors.
That's added with version 9. It gives the standardized residuals, which are the eta's in your previous question. RVECTORS gives the unadjusted residuals which aren't really useful for any diagnostics since they are heteroscedastic.
Re: stand. BEKK & Trigonal. BEKK
Posted: Thu Dec 25, 2014 5:24 pm
by econo
Dear Tom;
I used the version 9.0 so I got this error after the running this SET :
## MAT15. Subscripts Too Large or Non-Positive
Error was evaluating entry 2355
But I got ETA series. Thanks alot
Re: stand. BEKK & Trigonal. BEKK
Posted: Tue Jan 13, 2015 5:23 am
by econo
Dear Tom;
I checked several times , the ETA is not normally distributed! it looks like normal but has skewness, so as I checked it follows Logistic distribution.
I was wondering maybe something wrong!
I really appreciate, if you can help me to access the residuals.
best regards
Re: stand. BEKK & Trigonal. BEKK
Posted: Tue Jan 13, 2015 7:33 am
by TomDoan
omid_ie wrote:Dear Tom;
I checked several times , the ETA is not normally distributed! it looks like normal but has skewness, so as I checked it follows Logistic distribution.
I was wondering maybe something wrong!
I really appreciate, if you can help me to access the residuals.
best regards
First of all, the logistic isn't skewed either.
There's no reason to be concerned if the standardized residuals aren't Normal. If they have fat tails (rather than simple skewness), then you might need to use a conditional t distribution rather than the Normal. However, the estimates of the GARCH parameters are still consistent even if the residuals aren't conditionally Normal---you might need to add the ROBUSTERRORS option to correct the covariance matrix, but that's all.
Re: stand. BEKK & Trigonal. BEKK
Posted: Tue Jan 13, 2015 9:32 am
by econo
Dear Tom;
I am using Standard residuals to estimate Copula.
when I am using Univariate-garch, then finding standard residuals.using these standard residuals for estimating copula gives me reasonable results.
but ETA's from BEKK GARCH doesn't give me any reasonable results. Thats why I think something is not working right!
Re: stand. BEKK & Trigonal. BEKK
Posted: Tue Jan 13, 2015 10:06 am
by TomDoan
omid_ie wrote:Dear Tom;
I am using Standard residuals to estimate Copula.
when I am using Univariate-garch, then finding standard residuals.using these standard residuals for estimating copula gives me reasonable results.
but ETA's from BEKK GARCH doesn't give me any reasonable results. Thats why I think something is not working right!
The multivariate standardized residuals from a multivariate GARCH model will be very different from a set of univariate standardized residuals. The former are designed by construction to be uncorrelated with each other---the latter would, in the typical situation, be fairly highly correlated. So the fact that the results of applying copula analysis to them produces very different results wouldn't be unexpected. The correct process for copula estimation is to do the univariate marginal models. See
copula.rpf.