mgls

Purpose

Performs the MGLS unit root test.

Format

{ MZa, MZt, MSB, MPT, cvMZA, cvMZt, cvMSB, cvMPT } = MGLS(y, model[, bwl, varm])
Parameters:
  • y (Nx1 matrix) – Time series data to be test.
  • model (Scalar) –

    Model to be implemented.

    1 Constant.
    2 Constant and trend.
  • bwl (Scalar) – Optional, bandwidth for the spectral window. Default = round(4 * (T/100)^(2/9)).
  • 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
Returns:
  • MZa (Scalar) – MZalpha test statistic.
  • MZt (Scalar) – MZt test statistic.
  • MSB (Scalar) – MSB test statistic.
  • MPT – MPT test statistic.
  • cvMZa (Scalar) – 1, 5, and 10 percent critical values for MZa.
  • cvMZt (Vector) – 1, 5, and 10 percent critical values for MZt.
  • cvMSB (Vector) – 1, 5, and 10 percent critical values for MSB.
  • cvMPT (Vector) – 1, 5, and 10 percent critical values for MPT.

Examples

new;
cls;
library tspdlib;

// Load date file
y = loadd(__FILE_DIR $+ "ts_examples.csv", "Y + date($Date, '%b-%y')");

// With constant
model = 1;
{MZa, MZt, MSB, MPT, cvMZA, cvMZt, cvMSB, cvMPT} = MGLS(y, model);

// With constant and trend
model = 2;
{MZa, MZt, MSB, MPT, cvMZA, cvMZt, cvMSB, cvMPT} = MGLS(y, model);

Source

gls.src

See also

Functions adf(), lmkpss(), dfgls(), erspt()