How to retrieve cointegraing vectors & its dual in CATS 2.0

A forum for questions and answers regarding the CATS cointegration procedure

How to retrieve cointegraing vectors & its dual in CATS 2.0

Unread postby jzpan » Mon Mar 15, 2021 8:00 pm

Hi,

I'm estimating a VEC model in CATS 2.0, as shown below:
***********************************
CALENDAR(Q) 2000:1
DATA(FORMAT=RATS) 2000:01 2020:02 X1 X2 X3 X4 X5 DS1 DS2 DI3
@cats(lags=3,exo,break=level,dummy,dettrend=cidrift)
# X1 X2 X3 X4
# X5
# 2007:4
# DS1 DS2 DI3
**************************************
Where ds1, ds2, di3 are dummy variables.

I'm trying to achieve the Gonzalo & Granger decomposition (Gonzalo & Granger JBES 1995), as exemplified in the RATS code of Paper Replication Examples. One key step in that program is to store and retrieve all the eigenvectors/dualvectors when running the Johansen ML estimation, as specified in the options of <<JOHMLE>> procedure:

**********************************************************************
@johmle(lags=2,vectors=ejoint,dual=djoint,eigenval=vjoint)
# canst canmt canlt usast usamt usalt
***********************************************************************

My question is, how do I store and retrieve the same vectors(=ejoint), especially DUALVECTORS(=djoint), in my CATS program listed at the beginning? I guess I can't use <<JOHMLE>> for my VEC model since there are exogeneous variable, break, and dummies?

Thank you in advance for any help!

Jeff
jzpan
 
Posts: 4
Joined: Fri Mar 12, 2021 5:05 pm

Re: How to retrieve cointegraing vectors & its dual in CATS

Unread postby TomDoan » Wed Mar 17, 2021 10:09 am

That's a calculation that is specific to the Gonzalo-Granger analysis, and isn't included in CATS. (We searched both the manual and the program and found no mention of it). However, CATS does produce the matrices which are required for computing the dual vectors. The calculation of the dual vectors in JOHMLE is done with:

compute [symm] s01_11_10=%%s01*inv(%%s11)*tr(%%s01)
eigen(general=%%s00) s01_11_10 eigval dualvectors
compute dualvectors=%xsubmat(dualvectors,1,numvar,1,rank)

(The last line is to restrict it to the desired rank). CATS uses %s01 rather than %%s01 and %s11 rather than %%s11 (we added to extra % to avoid conflicts).

Whether the GG calculation is still valid when you add exogenous variables is for you to determine---it's not in the original paper.
TomDoan
 
Posts: 7452
Joined: Wed Nov 01, 2006 5:36 pm

Re: How to retrieve cointegraing vectors & its dual in CATS

Unread postby jzpan » Wed Mar 17, 2021 8:29 pm

Thank you so much, Tom! This is exactly I wanted. Is that possible that the last line should be:

compute dualvectors=%xsubmat(dualvectors,1,numvar,rank+1,numvar)

Since G-G eqn(24) indicates the dual vectors are the last (numvar - rank) vectors?

I'm not sure what the double %% sign are for. I ran into error msg with them so I just used single % instead after I shelled to RATS to execute the computation.

I also need to calculate the cointegrating vectors. Following your example this is what I have. Can you check if it's appropriate?

compute s10_00_01=tr(%s01)*inv(%s00)*%s01
eigen(general=%s11) s10_00_01 evalue_lmda evectors
compute v=%xsubmat(evectors,1,numvar,1,rank)

Thanks again!

Jeff

TomDoan wrote:That's a calculation that is specific to the Gonzalo-Granger analysis, and isn't included in CATS. (We searched both the manual and the program and found no mention of it). However, CATS does produce the matrices which are required for computing the dual vectors. The calculation of the dual vectors in JOHMLE is done with:

compute s01_11_10=%%s01*inv(%%s11)*tr(%%s01)
eigen(general=%%s00) s01_11_10 eigval dualvectors
compute dualvectors=%xsubmat(dualvectors,1,numvar,1,rank)

(The last line is to restrict it to the desired rank). CATS uses %s01 rather than %%s01 and %s11 rather than %%s11 (we added to extra % to avoid conflicts).

Whether the GG calculation is still valid when you add exogenous variables is for you to determine---it's not in the original paper.
jzpan
 
Posts: 4
Joined: Fri Mar 12, 2021 5:05 pm

Re: How to retrieve cointegraing vectors & its dual in CATS

Unread postby TomDoan » Tue May 18, 2021 12:35 pm

The code I pulled out of JOHMLE doesn't work as I originally wrote it because the s01_11_10 needs to be SYMMETRIC. (The GENERAL option on EIGEN only applies when the matrices involved are symmetric). The correct code is

compute [symm] s01_11_10=%%s01*inv(%%s11)*tr(%%s01)
eigen(general=%%s00) s01_11_10 eigval dualvectors
compute dualvectors=%xsubmat(dualvectors,1,numvar,1,rank)

We use %%.. in JOHMLE to not conflict with the similarly named %...'s in CATS. Lead %'s are just characters that are part of the symbol.
TomDoan
 
Posts: 7452
Joined: Wed Nov 01, 2006 5:36 pm

Re: How to retrieve cointegraing vectors & its dual in CATS

Unread postby jzpan » Tue May 18, 2021 7:10 pm

Thank you Tom! It worked this time. The manual calculations based on Sij matrices now exactly match the results from JOHMLE procedure.
To repeat the question I noted previously, should the last line be:

compute dualvectors=%xsubmat(dualvectors,1,numvar,rank+1,numvar)

instead?

TomDoan wrote:The code I pulled out of JOHMLE doesn't work as I originally wrote it because the s01_11_10 needs to be SYMMETRIC. (The GENERAL option on EIGEN only applies when the matrices involved are symmetric). The correct code is

compute [symm] s01_11_10=%%s01*inv(%%s11)*tr(%%s01)
eigen(general=%%s00) s01_11_10 eigval dualvectors
compute dualvectors=%xsubmat(dualvectors,1,numvar,1,rank)

We use %%.. in JOHMLE to not conflict with the similarly named %...'s in CATS. Lead %'s are just characters that are part of the symbol.


I'm so glad my original question is resolved finally. Thanks a lot!

Jeff
jzpan
 
Posts: 4
Joined: Fri Mar 12, 2021 5:05 pm

Re: How to retrieve cointegraing vectors & its dual in CATS

Unread postby TomDoan » Wed May 19, 2021 2:17 pm

That's for your application, not in general. If you look at the Gonzalo-Granger code, it pulls out the ones that are needed:

*
* gamma-perp (in GG's notation) will be the final p-r columns in the
* dual set of eigenvectors. alpha (the cointegrating vectors) will be
* the first r columns in the original set of eigenvectors
*
TomDoan
 
Posts: 7452
Joined: Wed Nov 01, 2006 5:36 pm

Re: How to retrieve cointegraing vectors & its dual in CATS

Unread postby jzpan » Wed May 19, 2021 3:03 pm

Thanks for the confirmation.
jzpan
 
Posts: 4
Joined: Fri Mar 12, 2021 5:05 pm


Return to CATS Questions

Who is online

Users browsing this forum: No registered users and 2 guests