VAR(1)-BEKK-GARCH(1,1) Model
VAR(1)-BEKK-GARCH(1,1) Model
I am estimating a bivariate VAR(1)-BEKK-GARCH(1,1) model between two financial series to test volatility spillovers and persistence of spillovers from one series to another. I have daily data for 12 years (3220 observations). I want to use the BHHH algorithm to estimate the model.
I wanted to know the exact code to run the above model.
Thanks,
Humyra
I wanted to know the exact code to run the above model.
Thanks,
Humyra
Re: VAR(1)-BEKK-GARCH(1,1) Model
system(model=varmodel) variables y1 y2 lags 1 to number_of_lags_you_want det constant end(system) * garch(model=varmodel,mv=bekk,method=bhhh)Note, however, that we don't recommend using BHHH as the primary estimation method. See the User's Guide.
Re: VAR(1)-BEKK-GARCH(1,1) Model
I also want to know the code to estimate the variance covariance matrix for my bivariate case, and how to generate the two conditional variance as well as the conditional covariance equations.
Thank you.
Thank you.
Re: VAR(1)-BEKK-GARCH(1,1) Model
You don't need "equations". The covariances are generated by the GARCH instruction and can be saved using the HMATRICES or MVHSERIES option depending upon what you want to do.humyra wrote:I also want to know the code to estimate the variance covariance matrix for my bivariate case, and how to generate the two conditional variance as well as the conditional covariance equations.
Thank you.
Re: VAR(1)-BEKK-GARCH(1,1) Model
Is this final code correct if I am estimating a bivariate VAR(1)-BEKK-GARCH(1,1) model? Am I missing out on anything?
system(model=varmodel)
variables y1 y2
lags 1
det constant
end(system)
*
garch(p=1,q=1,model=varmodel,mv=bekk,pmethod=simplex,piters=10,rseries=rs,mvhseries=hhs,stdresids=zu)
*
@mvqstat(lags=5)
# zu
@mvarchtest(lags=5)
# zu
I also tried using the BHHH algorithm but my model did not converge. Any idea why this happened?
system(model=varmodel)
variables y1 y2
lags 1
det constant
end(system)
*
garch(p=1,q=1,model=varmodel,mv=bekk,pmethod=simplex,piters=10,rseries=rs,mvhseries=hhs,stdresids=zu)
*
@mvqstat(lags=5)
# zu
@mvarchtest(lags=5)
# zu
I also tried using the BHHH algorithm but my model did not converge. Any idea why this happened?
Re: VAR(1)-BEKK-GARCH(1,1) Model
It depends upon what "doesn't converge" means. If it didn't converge in the standard number of iterations without any nasty looking messages, then just increase the ITERATIONS option. If it gives you a message that the estimation stalled, then it's possible that you're trying to fit a GARCH model to a data set that isn't well explained by a GARCH model. If you can post the output that you're getting, I can probably help you more.
Re: VAR(1)-BEKK-GARCH(1,1) Model
This is the code:
OPEN DATA "C:\Users\Humyra1\Desktop\Humyra - Data.xlsx"
CALENDAR(D) 2005:1:3
DATA(FORMAT=XLSX,ORG=COLUMNS) 2005:01:03 2017:05:05 Citi MXWO
system(model=varmodel)
variables Citi MXWO
lags 1
det constant
end(system)
*
garch(model=varmodel,mv=bekk,method=bhhh,iterations=1000)
However, simplex works fine but I am still getting significant ARCH effects when I apply the mvgarch test.
OPEN DATA "C:\Users\Humyra1\Desktop\Humyra - Data.xlsx"
CALENDAR(D) 2005:1:3
DATA(FORMAT=XLSX,ORG=COLUMNS) 2005:01:03 2017:05:05 Citi MXWO
system(model=varmodel)
variables Citi MXWO
lags 1
det constant
end(system)
*
garch(model=varmodel,mv=bekk,method=bhhh,iterations=1000)
However, simplex works fine but I am still getting significant ARCH effects when I apply the mvgarch test.
- Attachments
-
- BHHH.RPF
- (5.73 KiB) Downloaded 2329 times
-
- Humyra - Data.xlsx
- (135.86 KiB) Downloaded 1902 times
Re: VAR(1)-BEKK-GARCH(1,1) Model
I'm not sure what you did with the data before the GARCH instruction, but this works fine and produces reasonable looking output. Note that it does not converge with BHHH, which is a common problem and why we don't recommend it. (The options for saving the output have no effect on the estimation).
OPEN DATA "C:\TEMP\Humyra - Data.xlsx"
DATA(FORMAT=XLSX,ORG=COLUMNS) 1 3220 Citi MXWO
*
system(model=varmodel)
variables citi mxwo
lags 1
det constant
end(system)
garch(model=varmodel,mv=bekk,pmethod=simplex,piters=10,method=bfgs)
OPEN DATA "C:\TEMP\Humyra - Data.xlsx"
DATA(FORMAT=XLSX,ORG=COLUMNS) 1 3220 Citi MXWO
*
system(model=varmodel)
variables citi mxwo
lags 1
det constant
end(system)
garch(model=varmodel,mv=bekk,pmethod=simplex,piters=10,method=bfgs)
Re: VAR(1)-BEKK-GARCH(1,1) Model
Thank you for all your help!
So I should stick to simplex rather than BHHH.
Wpuld you able to suggest why the mvarchtest on the standard residuals is significant?
Also, I can't seem to display the covariance variance matrix. What's the code for that?
So I should stick to simplex rather than BHHH.
Wpuld you able to suggest why the mvarchtest on the standard residuals is significant?
Also, I can't seem to display the covariance variance matrix. What's the code for that?
Re: VAR(1)-BEKK-GARCH(1,1) Model
I also want to calculate the the two conditional variance and one conditional covariance equation (I've attached a picture). Is RATS able to do that?
- Attachments
-
- Var Covar Equations.PNG (31.46 KiB) Viewed 103235 times
Re: VAR(1)-BEKK-GARCH(1,1) Model
First of all, the main estimation algorithm is BFGS, not simplex. Simplex is used for preliminary iterations. You really need to read through the chapter in the User's Guide.humyra wrote:Thank you for all your help!
So I should stick to simplex rather than BHHH.
Wpuld you able to suggest why the mvarchtest on the standard residuals is significant?
Also, I can't seem to display the covariance variance matrix. What's the code for that?
There isn't a covariance matrix---there are 3000 of them, one for each data point. That's why they're generally graphed.
If you realize that a GARCH model isn't intended as a description of the actual process, but only as an approximation, the fact that you don't get an overwhelming rejection with 3000 data points is a good sign.
Re: VAR(1)-BEKK-GARCH(1,1) Model
That's just what you get when you multiply out the equations for the BEKK GARCH. That's what the GARCH instruction produces as I described earlier.humyra wrote:I also want to calculate the the two conditional variance and one conditional covariance equation (I've attached a picture). Is RATS able to do that?
Re: VAR(1)-BEKK-GARCH(1,1) Model
Thank you for all your helpful comments. I have read through the user guide but still tend to get confused.
One last thing. When I apply the @mvqtest and @mvarch test with lag 5, this is the output I get:
Multivariate Q(5)= 29.79475
Significance Level as Chi-Squared(20)= 0.07325
Test for Multivariate ARCH
Statistic Degrees Signif
78.32 45 0.00153
However, I have seen a couple of papers with a high number of lags. If I increase lag length to maybe 40, this is what I get:
Multivariate Q(40)= 182.65145
Significance Level as Chi-Squared(160)= 0.10604
Test for Multivariate ARCH
Statistic Degrees Signif
373.69 360 0.29856
What do you think?
Humyra
One last thing. When I apply the @mvqtest and @mvarch test with lag 5, this is the output I get:
Multivariate Q(5)= 29.79475
Significance Level as Chi-Squared(20)= 0.07325
Test for Multivariate ARCH
Statistic Degrees Signif
78.32 45 0.00153
However, I have seen a couple of papers with a high number of lags. If I increase lag length to maybe 40, this is what I get:
Multivariate Q(40)= 182.65145
Significance Level as Chi-Squared(160)= 0.10604
Test for Multivariate ARCH
Statistic Degrees Signif
373.69 360 0.29856
What do you think?
Humyra
Re: VAR(1)-BEKK-GARCH(1,1) Model
Using a high number of lags seems like a way to get an insignificant result---there's no reason to believe that there will be any residual GARCH effect at lags of 20, 30, 40.
Re: VAR(1)-BEKK-GARCH(1,1) Model
Hi Tom,
I have several questions.
Is there are a way to obtain the three variance equations that I have posted earlier through RATS?
Also, I have seen people posting this command for multivariate diagnostics:
dec vect[series] zu(%nvar)
do time=%regstart(),%regend()
compute %pt(zu,time,%solve(%decomp(hh(time)),rd(time)))
end do time
What does this do?
How are the hmatrices or the rvectors graphed?
Also how can I export all my results to Word or Excel?
Thanks,
Humyra
I have several questions.
Is there are a way to obtain the three variance equations that I have posted earlier through RATS?
Also, I have seen people posting this command for multivariate diagnostics:
dec vect[series] zu(%nvar)
do time=%regstart(),%regend()
compute %pt(zu,time,%solve(%decomp(hh(time)),rd(time)))
end do time
What does this do?
How are the hmatrices or the rvectors graphed?
Also how can I export all my results to Word or Excel?
Thanks,
Humyra