Description Usage Arguments Details Value See Also Examples
A quick way to investigate the short run relationship of cointegrating variables moving to equilibrium.
The function creates the formula format for the VECM equation from the cointegrating relationship.
Where the cointegrating relationship is Y ~ X1 + X2
and the non-stationary variables are c(z1, z2)
, the VECM equation is diff(Y) ~ 1 + L(ErrPos, 1) + L(ErrNeg, 1) + L(diff(X1), 1:k) + L(diff(X2), 1:k) + L(diff(Y), 1:k) + L(z1, 1:k) + L(z2, 1:k)
, with k = the number of lags.
ErrPos and ErrNeg come from the Error equation Y - Yhat predicted from the coefficients*parameters of a DOLS equation.
It then determines a maximum lag number based of off the number of observations using an ad hoc method and runs the model ad the varying lag sizes, keeping the observation start and end dates restricted to the strictest range. The final number of lags to be chosen is selected by choosing the smallest akaike information criterion value (AIC).
It also calculates the robust standard errors using Newey West with assistance of the lmtest and sandwhich packages.
1 |
coint_fomula |
A representation of the formula that will be built into the VECM short-term equation. |
data |
The data frame containing the variables to be called by the formula. |
stationary_vars |
A continuation of the formula consisting of stationary variables within data. Must be written with a leading "~" in the format of "~ Z1" to work. |
fixedk |
The number of lags that the output will have. If is NULL, determines the number of lags through model selection, starting at a maximum value of |
SplitError |
Default is TRUE. If TRUE will include a positive Error and a negative Error term in the model to highlight asymmetries. |
robusterrors |
The HAC estimator. |
fixedk_DOLS |
The number of lags/leads that the internal DOLS output, which is used to create the error corrrection term, will have. If is NULL, determines the number of lags/leads through model selection, starting at a maximum value of |
selection |
The funciton used during model selection. Default set to BIC but can match any function that acts on a model object |
A formula has an implied intercept term. To remove this use either y ~ x - 1
or y ~ 0 + x
.
Error |
returns a 3 column matrix of the decomposed Error (y-yhat from the DOLS non-nuissance parameters), only the Positive changes in Error, and the Negative changes in Error. |
selection |
returns a table showing the lags and the AIC, fixed observations, for choosing the number of lags to use. |
lags |
returns the # of lags identified for the model with the smallest AIC. |
HAC |
returns the robust errors implementing the Newey & West (1987, 1994) heteroskedasticity and autocorrelation consistent (HAC) covariance matrix estimators. |
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.