coint_ghansen

Purpose

Tests for the null of no cointegration against the alternative of cointegration with a structural break in the mean.

Format

{ ADF_min, TBadf, Zt_min, TBzt, Za_min, TBza, cvADFZt, cvZa } = coint_ghansen(y, x, model[, bwl, ic, pmax, varm, trimm])
Parameters:
  • y (Nx1 matrix) – Dependent variable.
  • x (NxK matrix) – Independent variable.
  • model (Scalar) –

    Model to be implemented.

    1 C (level shift)
    2 C/T (level shift with trend)
    3 C/S (regime shift)
    4 Regime and trend shift
  • bwl (Scalar) – Optional, bandwidth length for long-run variance computation. Default = round(4 * (T/100)^(2/9)).
  • ic (Scalar) –

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

    1 Akaike.
    2 Schwarz.
    3 t-stat significance
  • pmax (Scalar) – Optional, maximum number of lags for \(\delta y\) in ADF test. Default = 8.
  • varm (Scalar) –

    Optional, long-run consistent variance estimation method. Default = 1.

    1 iid.
    2 Bartlett.
    3 Quadratic Spectral (QS).
    4 SPC with Bartlett (Sul, Phillips & Choi, 2005)
    5 SPC with QS
    6 Kurozumi with Bartlett
    7 Kurozumi with QS
  • trimm (Scalar) – Optional, trimming rate. Default = 0.10.
Returns:
  • ADFmin (Scalar) – ADF test statistic
  • TBadf (Scalar) – Break point using OLS.
  • Zamin (Scalar) – Za test statistic
  • TBza (Scalar) – Break point for using Za statistic.
  • Ztmin (Scalar) – Zt test statistic
  • TB_zt (Scalar) – Break point using Zt statistic.
  • cvADFZt (Scalar) – 1%, 5%, 10% critical values for ADF and Zt test statistics.
  • cvZa (Scalar) – 1%, 5%, 10% critical values for Za test statistics.

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)];

// Level shift
model = 1;

{ ADF_min, TBadf, Zt_min, TBzt, Za_min, TBza, cvADFZt, cvZa } = coint_ghansen(y, x, model);

Source

coint_ghansen.src