pyeeg.connectivity.granger_causality

pyeeg.connectivity.granger_causality(X, nlags=1, time_axis=0, verbose=False)

Compute the Granger causality matrix of a multivariate time series.

Parameters:
  • X (ndarray, shape (nsamples, nchannels)) – Input data.

  • nlags (int) – Number of lags to use in the model. (model order)

  • time_axis (int) – Axis along which time runs. Default is 0.

Returns:

GC – Granger causality matrix.

Return type:

ndarray, shape (nchannels, nchannels)

TODO: now apparently I am computing whether all signals are causing each other, but I should compute whether each signal is causing the others, so I should loop over the dimensions and compute the GC for each pair of signals??….