*
* ECT.RPF
* Estimation of a Vector Error Correction model
*
* RATS User's Guide, Example from Section 7.8.
*
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)
*
* Allowing for two cointegrating vectors. (The results of the
* cointegration test suggest that one is adequate).
*
@johmle(lags=6,det=rc,vectors=cvectors)
# ftbs3 ftb12 fcm7
equation(coeffs=%xcol(cvectors,1)) ect1 *
# ftbs3 ftb12 fcm7 constant
equation(coeffs=%xcol(cvectors,2)) ect2 *
# ftbs3 ftb12 fcm7 constant
*
system(model=ect2model)
variables ftbs3 ftb12 fcm7
lags 1 to 6
ect ect1 ect2
end(system)
estimate
errors(model=ect2model,steps=36)