Learn R Programming

tsDyn (version 0.9-32)

VECM: Estimation of Vector error correction model (VECM)

Description

Estimate either a VECM by Engle-Granger or Johansen (MLE) method.

Usage

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

Arguments

data
multivariate time series (first row being first=oldest value)
lag
Number of lags (in the VECM representation, see Details)
r
Number of cointegrating relationships
include
Type of deterministic regressors to include
beta
Possibility to impose a cointegrating value. By default is null, so values will be estimated
LRinclude
Type of deterministic regressors to include in the long-term relationship. Can also be a matrix with exogeneous regressors (2OLS only).
estim
Type of estimator: 2OLS for the two-step approach or ML for Johansen MLE
exogen
Inclusion of exogenous variables (first row being first=oldest value). Is either of same size than data (then automatically cut) or than end-sample.

Value

  • An object of class VECM (and higher classes VAR and nlVar) with methods: [object Object],[object Object],[object Object],[object Object],[object Object]

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: [object Object],[object Object],[object Object],[object Object]

Two estimators are available: the Engle-Granger two step approach (2OLS) or the Johansen (ML). For the 2OLS, deterministics regressors (or external variables if LRinclude is of class numeric) can be added for the estimation of the cointegrating value and for the ECT. This is only working when the beta value is not pre-specified.

The arg beta is the cointegrating value, the cointegrating vector will be taken as: (1, -beta).

Note that the lag specification corresponds to the lags in the VECM representation, not in the VAR (as is done in package vars or software GRETL). Basically, a VAR with 2 lags corresponds here to a VECM with 1 lag. Lag 0 in the VECM is not allowed.

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