ecm {aTSA} | R Documentation |
Error Correction Model
Description
Fits an error correction model for univriate response.
Usage
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 |
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
where is an operator of the first order difference, i.e.,
, and
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 which is the
main term in the sense that its coefficient
explains the short term
dynamic relationship between
y
and X
in this model, in which is estimated from the linear regression model
. Here,
and
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
X <- matrix(rnorm(200),100,2)
y <- 0.1*X[,1] + 2*X[,2] + rnorm(100)
ecm(y,X)