granger#

Purpose#

Computes the tests for Granger causality of specified variables.

Format#

GC_out = granger(data, test[, pmax, ic, Nboot, vnames])#
Parameters:
  • data (Txk matrix) – Data to be tested with k individual variables each in a separate column.

  • test (Scalar) –

    Test option for Granger causality

    0

    Granger causality.

    1

    Toda & Yamamoto

    2

    Single Fourier-frequency Granger causality.

    4

    Single Fourier frequency Toda & Yamamoto.

    5

    Cumulative Fourier-frequency Toda & Yomamoto

  • pmax (Scalar) – Optional, maximum number of lags. Default = 8.

  • ic (Scalar) –

    Optional, the information criterion used for choosing lags.

    1

    Akaike.

    2

    Schwarz.

    3

    t-stat significance.

    Default = 2.

  • Nboot (Scalar) – Number of bootstrap replications.

  • vnames (String array) – Variable names. Default = dataframe variable names OR “X1”$|”X2”.

Returns:

GC_out (Kx5 Matrix) – Results matrix containing Wald stat~P-values~Bootstrap P-values~Lags~Frequency

Examples#

library tspdlib;

// Load data matrix
GCdata = loadd(getGAUSSHome() $+ "pkgs/tspdlib/examples/TScaus.dat");
data   = ln(GCdata);

// Toda & Yamamoto test
test = 1;

// Run test
GC_out = granger(data, test);

Source#

gctests.src