johansen_eigen — calculate eigen values of a johansen procdure
[flag,lambda,dt,lr1,lr2,pi,s00]=johansen_eigen(dx,exo_st,exo_lt)
dx = a a (nobs x ny) vector of differentiated endogenous variables
exo_st = a (nobs x (ny*k+nexo_st) vector of exogenous variables in the short term dynamic (= the lagged differentiated endogenous variables + the exogenous variables outside the cointegration vectors)
exo_lt = a (nobs x (ny+nexo_lt) vector of lagged endogenous variables (in level) and exogenous variables incorporated to the cointegration vectors
flag = a flag ('Ok'/'not OK') indicating whether the problem is well specified
lambda = a (ny x 1) vector of eigenvalues of the reduced rank regression
dt = a (nobs x ny) matrix, each column being a cointegration vector
lr1 = a (ny x 1) vector of trace tests statistics
lr2 = a (ny x 1) vector of lambda max
pi = a ((ny+nexo_lt) x ny) matrix of combined effects of the variables in the cointegration relations on the differentiated endogenous variables
s00 = a (ny x ny) matrix, equal to the variance of the residuals of the regression of dx on exo_st
dy = tdiff(y,1); exo=trimr([mlag(dy,grocer_k) exo_st],grocer_k+1,0) lagy = trimr([lag(y,1) exo_lt],grocer_k+1,0) dy=trimr(dy,grocer_k+1,0) [flag,a,evec,lr1,lr2,pi]=johansen_eigen(dy,exo,lagy) // Example taken from function johansen. Starting from a matrix y of variables in level, a matrix of short run exogenous variables exo_st and a matrix of long run exogenous variables exo_lt, builds the lagged matrix dy, the matrix of the short run dynamic exo_st and the matrix of the long run cointegration space exo_lt and calculates the corresponding cointegration eigenvalues and eigenvectors.