Page 1 of 1

Matrix of Loadings in VECM-GARCH

Posted: Mon May 11, 2015 10:59 am
by klaus86
Dear all,

I would like to estimate a bivariate VECM-BEKK model and then compute the orthogonal vector to the error correction coefficients which I need for the calculation of information shares. However, I run into problems when I try to do this in RATS.
I have done this procedure before in the framework of a standard VECM without GARCH errors:

Code: Select all

set logspot = log(spot)
set logfutures = log(futures)
*
*
*Restrict cointegrating relationship:
equation(coeffs=||1.0,-1.0||) eqxy
# logfutures logspot
*
system(model=vecm)
variables logfutures logspot
lags 1 to 3
det constant
ect eqxy
end(system)
estimate
*Compute orthogonal vector to error correction coefficients:
compute alphaperp=%perp(%vecmalpha)
This works fine. However, it does not work when I try to estimate the above model with GARCH errors (in my case a standard BEKK-model) by replacing the command "estimate" with the following instruction:

Code: Select all

garch(model=vecm,mv=bekk,hmatrices=h, MVHSERIES=bekkHmatrix, rvectors=r,pmethod=simplex,piters=5,method=bfgs,iters=400)
Apparently the error correction term is somewhat ignored in this estimation as it is not displayed in the output. Consequently, the calculation of the orthogonal vector to %vecmalpha is also ignored. I managed to reformulate the VECM-BEKK so that it includes the error correction term:

Code: Select all

set retspot = log(spot)-log(spot{1})
set retfutures = log(futures)-log(futures{1})
set ect = log(futures)-log(spot)
*
system(model=vecm)
variables retspot retfutures
lags 1 to 3
det constant ect{1}
end(system)
*
* Estimate by GARCH-BEKK
*
garch(model=vecm,mv=bekk,hmatrices=h, MVHSERIES=bekkHmatrix, rvectors=r,pmethod=simplex,piters=5,method=bfgs,iters=400)
Yet when I try to calculate the orthogonal vector to the error correction coefficients, i.e.:

Code: Select all

compute alphaperp=%perp(%vecmalpha) 
I get the error:
## I1. Expected Instruction - ALP Is Not Recognizable As One
>>>>alphaperp=<<<<
Any suggestions how I can solve this issue?
Thanks a lot.

Re: Matrix of Loadings in VECM-GARCH

Posted: Mon May 11, 2015 11:43 am
by TomDoan
%VECMALPHA also only gets defined by ESTIMATE, not by GARCH. As you have this set up, you can fetch the alpha's with

compute vecmco=%modelgetcoeffs(vecm)
compute alpha=tr(%xrow(vecmco,8))

which will be a 2 x 1 vector. You can then do

compute alphaperp=%perp(alpha)

Re: Matrix of Loadings in VECM-GARCH

Posted: Tue May 12, 2015 4:06 am
by klaus86
Thanks Tom. This works fine.

Re: Matrix of Loadings in VECM-GARCH

Posted: Fri Dec 11, 2015 1:05 am
by ad15
Hi Tom,
I am able to fetch alpha's from this code. Please help me
I used the following command
set retspot = log(spot)-log(spot{1})
set retfutures = log(futures)-log(futures{1})
set ect = log(futures)-log(spot)
system(model=vecm)
variables retspot retfutures
lags 1 to 3
det constant ect{1}
end(system)
garch(model=vecm,mv=bekk,hmatrices=h, MVHSERIES=bekkHmatrix, rvectors=r,pmethod=simplex,piters=5,method=bfgs,iters=400)
compute vecmco=%modelgetcoeffs(vecm)
compute alpha=tr(%xrow(vecmco,8))
compute alphaperp=%perp(alpha)

Please help. Thanks.



%VECMALPHA also only gets defined by ESTIMATE, not by GARCH. As you have this set up, you can fetch the alpha's with

compute vecmco=%modelgetcoeffs(vecm)
compute alpha=tr(%xrow(vecmco,8))

which will be a 2 x 1 vector. You can then do

compute alphaperp=%perm(alpha)

Re: Matrix of Loadings in VECM-GARCH

Posted: Fri Dec 11, 2015 7:15 am
by TomDoan
Sorry. What's the question? alpha will have the alpha's. The previous poster needed its "perp" for further calculations, but if you just need the loadings, you already have that.

Re: Matrix of Loadings in VECM-GARCH

Posted: Fri Dec 11, 2015 8:23 am
by ad15
Dear Tom.
I am not able to extract alpha. When I am writing the code as
garch(model=vecm,mv=bekk,hmatrices=h, MVHSERIES=bekkHmatrix, rvectors=r,pmethod=simplex,piters=5,method=bfgs,iters=400)
compute vecmco=%modelgetcoeffs(vecm)
compute alpha=tr(%xrow(vecmco,8))
compute alphaperp=%perp(alpha)
print
I see only one ECT term and VCVs of MGARCH.
compute vecmco=%modelgetcoeffs(vecm)
compute alpha=tr(%xrow(vecmco,8))
compute alphaperp=%perp(alpha)
I am not getting alpha perpendicular. How to get that. Please help thanks.

Re: Matrix of Loadings in VECM-GARCH

Posted: Fri Dec 11, 2015 8:47 am
by TomDoan
Yes, you have. The loadings are in alpha and the perp of that is in alphaperp. If you want to see them, use a DISPLAY instruction---COMPUTE computes, it doesn't show.