coint_egranger

Purpose

Computes the Engle-Granger test of the null hypothesis of no cointegration against the alternative of cointegration.

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%, 10% critical values for chosen model.

Examples

library tspdlib;

// Load dataset
data = loadd(getGAUSSHome() $+ "pkgs/tspdlib/examples/ts_coint.csv",
                                 ". + date($Date, '%b-%y')");

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

// No constant or trend
model = 0;

// Call test
{ tau, cvADF } = coint_egranger(y, x, model);

Source

coint_egranger.src