* * Enders, Applied Econometric Time Series, 4th edition * Example from Section 6.9, pp 389-393 * Johansen ML cointegration analysis * open data coint6.xls data(format=xls,org=columns) 1 100 y z w * @varlagselect(lags=6,crit=aic) # y z w * @johmle(lags=%%autop,det=rc,cv=cv,eigval=eigval) # y z w * * Normalize to a unit coefficient on y (first coefficient) * compute cv=cv/cv(1) disp "Normalized Cointegrating Vector" cv * * Compute pi * x * set lrerror = %dot(cv,||y,z,w,1.0||) * equation(coeffs=cv) ecteq # y z w constant * * Define the VECM. The loadings on the cointegrating relation are the * opposite sign since these are normalized with beta1=1.0, rather than * beta1=-1.0. Note that there is no CONSTANT in this. The CONSTANT is * restricted to the cointegrating vector which means that the processes * won't have a "drift". * system(model=vecm) variable y z w lags 1 to %%autop ect ecteq end(system) * estimate(resids=vecmr) * graph(footer="Figure 6.4 Long-Run and Short-Run Errors") 2 # lrerror # vecmr(1) * compute [symm] s10_00_01=tr(%%s01)*inv(%%s00)*%%s01 * * Restriction that beta0 is 0.0 * compute h=%identity(3)~~%zeros(1,3) eigen(general=%mqform(%%s11,h)) %mqform(s10_00_01,h) eigvalr eigvecr * * LR test of restriction given 1 cointegrating relation * compute lr=%nobs*log(1-eigvalr(1))-%nobs*log(1-eigval(1)) cdf(title="Test of zero intercept in cointegrating vector") chisqr lr 1 * * Restriction that beta1,beta2,beta3 are in proportion (1,1,-1) * dec rect h(4,2) input h 1.0 0.0 1.0 0.0 -1.0 0.0 0.0 1.0 eigen(general=%mqform(%%s11,h)) %mqform(s10_00_01,h) eigvalr eigvecr compute lr=%nobs*log(1-eigvalr(1))-%nobs*log(1-eigval(1)) cdf(title="Test of relative PPP restriction") chisqr lr 2 * * Restriction that beta1,beta2,beta3 are in proportion to (1,1,-1) AND * beta0 is 0.0 * dec rect h(4,1) input h 1.0 1.0 -1.0 0.0 eigen(general=%mqform(%%s11,h)) %mqform(s10_00_01,h) eigvalr eigvecr compute lr=%nobs*log(1-eigvalr(1))-%nobs*log(1-eigval(1)) cdf(title="Test of absolute PPP restriction") chisqr lr 3