ecm: Error Correction Model

Description Usage Arguments Details Value Note Author(s) References Examples

View source: R/ecm.R

Description

Fits an error correction model for univriate response.

Usage

1
ecm(y, X, output = TRUE)

Arguments

y

a response of a numeric vector or univariate time series.

X

an exogenous input of a numeric vector or a matrix for multivariate time series.

output

a logical value indicating to print the results in R console. The default is TRUE.

Details

An error correction model captures the short term relationship between the response y and the exogenous input variable X. The model is defined as

dy[t] = bold{β}[0]*dX[t] + β[1]*ECM[t-1] + e[t],

where d is an operator of the first order difference, i.e., dy[t] = y[t] - y[t-1], and bold{β}[0] is a coefficient vector with the number of elements being the number of columns of X (i.e., the number of exogenous input variables), and ECM[t-1] = y[t-1] - hat{y}[t-1] which is the main term in the sense that its coefficient β[1] explains the short term dynamic relationship between y and X in this model, in which hat{y}[t] is estimated from the linear regression model y[t] = bold{α}*X[t] + u[t]. Here, e[t] and u[t] are both error terms but from different linear models.

Value

An object with class "lm", which is the same results of lm for fitting linear regression.

Note

Missing values are removed before the analysis. In the results, dX or dX1, dX2, ... represents the first difference of each exogenous input variable X, and dy is the first difference of response y.

Author(s)

Debin Qiu

References

Engle, Robert F.; Granger, Clive W. J. (1987). Co-integration and error correction: Representation, estimation and testing. Econometrica, 55 (2): 251-276.

Examples

1
2
3
X <- matrix(rnorm(200),100,2)
y <- 0.1*X[,1] + 2*X[,2] + rnorm(100)
ecm(y,X)

Example output

Attaching package: 'aTSA'

The following object is masked from 'package:graphics':

    identify


Call:
lm(formula = dy ~ dX + ECM - 1)

Residuals:
     Min       1Q   Median       3Q      Max 
-1.88214 -0.37597  0.03839  0.55150  2.58179 

Coefficients:
     Estimate Std. Error t value Pr(>|t|)    
dX1  0.009107   0.053421   0.170    0.865    
dX2  2.122455   0.061425  34.553  < 2e-16 ***
ECM -0.892494   0.100403   8.889 3.62e-14 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 0.7709 on 96 degrees of freedom
Multiple R-squared:  0.9293,	Adjusted R-squared:  0.9271 
F-statistic: 420.8 on 3 and 96 DF,  p-value: < 2.2e-16

aTSA documentation built on May 29, 2017, 11:44 a.m.