Page 1 of 1
Looping for VAR-BEKK GARCH Model
Posted: Mon May 18, 2020 9:32 am
by lendraniestiko01
Hello everyone,
In the forum, it has been explained in order to run VAR-BEKK GARCH Model, the code is:
Code: Select all
system(model=varmodel)
variables y1 y2
lags 1 to number_of_lags_you_want
det constant
end(system)
*
garch(model=varmodel,mv=bekk,method=bfgs)
I have variables from X1, X2, ..... , Xn and i need to run pairwise-bivariate VAR(1)-BEKK GARCH(1,1) model with assumed one lag for each variables (Example: X1 and X2, X1 and X3,....... ,Xn-1 and xn). I am very new to RATS so i am not familiar with how the looping code works and i have been looking at the instructions manual but i have a difficult time to understand it as i have little experience with programming even with other stat programs
Can anyone help me on this?
Thank you for the assistance beforehand
Re: Looping for VAR-BEKK GARCH Model
Posted: Mon May 18, 2020 11:28 am
by TomDoan
To generate all pairs, you run an "I" loop over 1 to N-1 and inside it a loop from I+1 to N. (There are other equivalent ways to generate all pairs). This assumes the series are actually named Y1 to Yn (whatever the value of N is).
Code: Select all
do i=1,n-1
do j=i+1,n
system(model=varmodel)
variables %s("Y"+i) %s("Y"+j)
lags 1 to number_of_lags_you_want
det constant
end(system)
*
garch(model=varmodel,mv=bekk,method=bfgs)
end do j
end do i
Re: Looping for VAR-BEKK GARCH Model
Posted: Mon May 18, 2020 4:38 pm
by lendraniestiko01
Thank you Tom for the reply,
It works well for me. Can i ask one more thing regarding this?
Unfortunately instead of having my variable named Y1 to YN, i have named my variables in following manner: typeofasset_countryof asset (example: eq_cn, eq_id,....,bm5_cn, bm5_id,...., bm10_cn, bm10_id,...,fx_cn, fx_id,...,mm_cn,mm_id,.....)
Understanding this, do you have any suggestion to generate all pairs?
Thank you again in advance.
Re: Looping for VAR-BEKK GARCH Model
Posted: Mon May 18, 2020 9:05 pm
by TomDoan
You want all pairs of those across all combinations of asset class and country?
Re: Looping for VAR-BEKK GARCH Model
Posted: Mon May 18, 2020 11:32 pm
by lendraniestiko01
Nevermind about my previous question because i found a way to work on it
Is there any way for me to store the result of all the estimation into one excel file? preferrably storing the name of the variables (and the matrix) containing coefficent and the significance
Re: Looping for VAR-BEKK GARCH Model
Posted: Tue May 19, 2020 12:46 pm
by TomDoan
As I pointed out to another poster recently, you might want to decide what exactly it is that you want. The full output from a two-variable VAR(1) BEKK model is about 1/2 a printed page by itself---if you're doing a lot of models, that's not going to be useful. REPORT is the way to handle that, but you really want to decide what you need in the report before you get going on that.
Re: Looping for VAR-BEKK GARCH Model
Posted: Fri May 22, 2020 7:10 pm
by lendraniestiko01
Noted, it worked wonderfully
Thank you!