lmkpss#

Purpose#

Computes the Kwiatkowski, Phillips, Schmidt, and Shin (KPSS) stationarity test.

Format#

{ kpss, cv } = LMkpss(y, model[, bwl, varm])#
Parameters:
  • y (Nx1 matrix) – Time series data to be tested.

  • 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:
  • kpss (Scalar) – The KPSS test statistic.

  • cvKPSS (Scalar) – 1%, 5%, and 10% critical values for the KPSS test statistic.

Examples#

library tspdlib;

// Load date file
y = loadd(getGAUSSHome() $+ "pkgs/tspdlib/examples/ts_examples.csv", "Y");

// Constant
model = 1;
{ kpss, cvKPSS } = lmkpss(y, model);

// Constant and trend
model = 2;
{ kpss, cvKPSS } = lmkpss(y, model);

Source#

kpss.src