Learn R Programming

tsDyn (version 0.7-60)

VECM: Estimation of Vector error correction model (VECM) by EG or MLE

Description

Estimate either a VAR or a VEC

Usage

VECM(data, lag,r=1, include = c( "const", "trend","none", "both"),beta=NULL, estim=c("2OLS", "ML"),LRinclude=c("none", "const", "trend","both"))

Arguments

data
multivariate time series
lag
Number of lags to include in each regime
r
Number of cointegrating relationships
include
Type of deterministic regressors to include
beta
for VECM only: cointegrating value. If null, will be estimated
LRinclude
Possibility to include in the long-run relationship and the ECT trend, constant... Can also be a matrix with exogeneous regressors
estim
Type of estimator for the VECM: '2OLS' for the two-step approach or 'ML' for Johansen MLE

Value

  • Fitted model data

code

ML

Details

This function is just a wrapper for the lineVar, with model="VECM".

More comprehensive functions for VECM are in package vars. A few differences appear in the VECM estimation:

  • Engle-Granger estimator
{The Engle-Granger estimator is available} Presentation{Results are printed in a different ways, using a matrix form} lateX export{The matrix of coefficients can be exported to latex, with or without standard-values and significance stars}

See Also

lineVar TVAR and TVECM for the correspoding threshold models. linear for the univariate AR model.

Examples

Run this code
data(zeroyld)
data<-zeroyld

#Fit a VECM with Engle-Granger 2OLS estimator:
vecm.eg<-VECM(zeroyld, lag=2)

#Fit a VECM with Johansen MLE estimator:
vecm.jo<-VECM(zeroyld, lag=2, estim="ML")

#compare results with package vars:
if(require(vars)) {
data(finland)
#check long coint values
all.equal(VECM(finland, lag=2, estim="ML", r=2)$model.specific$coint, cajorls(ca.jo(finland, K=3, spec="transitory"), r=2)$beta, check.attr=FALSE)
# check OLS parameters
all.equal(t(coefficients(VECM(finland, lag=2, estim="ML", r=2))), coefficients(cajorls(ca.jo(finland, K=3, spec="transitory"), r=2)$rlm), check.attr=FALSE)

}


##export to Latex
toLatex(vecm.eg)
toLatex(summary(vecm.eg))
options("show.signif.stars"=FALSE)
toLatex(summary(vecm.eg), parenthese="Pvalue")
options("show.signif.stars"=TRUE)

Run the code above in your browser using DataLab