Canonical Correlation

Econometrics questions and discussions

Canonical Correlation

Postby atrad » Wed Dec 26, 2007 2:30 pm

I'm trying to do canonical correlation analysis in RATS. If anyone has a piece of code that allows me to implement this procedure, I'd be grateful if they could post it on this site.
atrad
 
Posts: 5
Joined: Mon Apr 30, 2007 1:45 pm

Postby TomDoan » Tue Jan 22, 2008 6:53 pm

Actually, the Johansen MLE procedure for estimating cointegrating vectors is an application of canonical correlations (of the first differences on the lag levels after eliminating short-term components). If S is the grand covariance matrix of the Y,X variables, then the following (which has been stripped from the JOHMLE procedure) computes the canonical vectors as the columns of eigvec.

compute %%s00=%xsubmat(s, 1,numvar, 1,numvar)
compute %%s11=%xsubmat(s,numvar+1,sweepv,numvar+1,sweepv)
compute %%s01=%xsubmat(s, 1,numvar,numvar+1,sweepv)
*
* Compute the generalized eigenvalues and vectors
*
compute s10_00_01=tr(%%s01)*inv(%%s00)*%%s01
eigen(general=%%s11) s10_00_01 eigval eigvec
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Postby TomDoan » Tue Mar 25, 2008 10:26 am

There's a new procedure on the RATS Procedures forum for doing general canonical correlations.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm


Return to General Econometrics

Who is online

Users browsing this forum: No registered users and 1 guest