* * ECT.RPF * RATS Version 8, User's Guide, Example 7.7 * Estimation of an Error Correction model * cal(m) 1975:1 open data haverate.rat data(format=rats) 1975:1 2001:6 ftbs3 ftb12 fcm7 * * Test for unit roots in the original variables * @dfunit(lags=6) ftbs3 @dfunit(lags=6) ftb12 @dfunit(lags=6) fcm7 * * Use @JohMLE to test the cointegrating rank and estimate the * cointegrating vector corresponding to the largest eigenvalue. Note * that it is far from obvious (a priori) that the cointegrating rank * will be one. It might very well be zero, or, if there were a single * stochastic trend linking the yields, then the cointegrating rank would * be two. * * Because the series don't have a trend, the appropriate choice for the * deterministic component is det=rc, which doesn't include a constant in * the individual equations (where it would cause the series to drift * because of the unit roots), but restricts it to the cointegrating * vector. The components of the cointegrating vector produced by JohMLE * with this choice will have four components: the three variables + the * constant. If we had done the default DET=CONSTANT, it would only be a * 3-vector. We would also include DET CONSTANT in the SYSTEM definition. * @johmle(lags=6,det=rc,cv=cvector) # ftbs3 ftb12 fcm7 equation(coeffs=cvector) ecteq * # ftbs3 ftb12 fcm7 constant * * Set up the model with the error correction term * system(model=ectmodel) variables ftbs3 ftb12 fcm7 lags 1 to 6 ect ecteq end(system) * * Estimate it and compute the decomposition of variance * estimate compute sigma=%sigma errors(model=ectmodel,steps=36) * * Set up the model without the error correction term * system(model=ratemodel) variables ftbs3 ftb12 fcm7 lags 1 to 6 det constant end(system) * * Estimate and compute the decomposition of variance. This uses the same * covariance matrix of residuals as above. * estimate errors(model=ratemodel,steps=36,cv=sigma)