gc_tests

Purpose

Tests for Granger causality of specified variables.

Format

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

  • vnames (String array) – Variable names.

  • pmax (Scalar) – Maximum number of lags.

  • ic (Scalar) –

    The information criterion used for choosing lags.

    1

    Akaike.

    2

    Schwarz.

    3

    t-stat significance.

  • test

    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

  • Nboot (Scalar) – Number of bootstrap replications.

Returns

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

Examples

new;
cls;

library tspdlib;

// Number of bootstrap replications
Nboot= 1000;

// Number of observations
T  = 188;

// Number of lags in VAR model
pmax = 12;

// Information criterion
ic   = 1;

// Set to perform Granger Causality
test = 0;

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

// Variable names
vnames = "y1"$|"y2"$|"y3"$|"y4";

// Toda & Yamamoto test
test = 1;

GC_out = GC_tests(data, vnames, pmax, ic, test, Nboot);

Source

gctests.src