coint_egranger

Purpose

Engle-Granger cointegration test.

Format

{ tau, cvADF } = coint_egranger(y, x, model[, pmax, ic])
Parameters:
  • y (Nx1 matrix) – Dependent variable.
  • x (NxK matrix) – Independent variable.
  • model (Scalar) –

    Model to be implemented.

    0 No deterministic components.
    1 Constant only.
    2 Constant and trend.
  • pmax – Optional, maximum number of lags for \(\delta y\) in ADF test. Default = 8.
  • ic (Scalar) –

    Optional, the information criterion used for choosing lags. Default = 2.

    1 Akaike.
    2 Schwarz.
Returns:
  • tau (Scalar) – Engle & Granger (1987) ADF test.
  • cv (Vector) – 1, 5, and 10 percent critical values for chosen model.

Examples

new;
cls;
library tspdlib;

// Load dataset
data = loadd(__FILE_DIR $+ "ts_coint.csv",
                          "Y1 + Y2 + Y3 + Y4 + date($Date, '%b-%y')");

// Define y and x matrix
y = data[., 1];
x = data[., 2:cols(data)];

// No constant or trend
model = 0;
{ tau, cvADF } = coint_egranger(y, x, model);

Source

coint_egranger.src