dirconn.methods.statespace.spectral_state_space_gc#

dirconn.methods.statespace.spectral_state_space_gc(coefs: Any, noise_cov: Any, freqs: Any, sfreq: float, *, conditional: bool = True) → ndarray#

Spectral (Geweke) Granger causality of a VAR model from its state-space form.

For source X, target Y and the other channels Z of the model (all other channels when conditional, none otherwise), Geweke’s (1984) conditional measure is the unconditional spectral causality from (X, Z*) to Y*, where * marks the innovations of the reduced model of (Y, Z) (Chen, Bressler and Ding 2006; Barnett and Seth 2015):

f_{X->Y|Z}(f) = log( Sigma^R_YY / (Sigma^R_YY - Psi_YS(f) Sigma_{SS|Y} Psi_YS(f)^H) ),

with S = (X, Z), Sigma^R the innovation covariance of the reduced model, Psi = H_R^-1 H_{(Y,Z),:} the filter from the full innovations to the reduced ones and Sigma_{SS|Y} the partial covariance of the full innovations of S given that of Y. The mean of f over the whole unit circle is the time-domain value of state_space_gc(); for two channels f is Geweke’s (1982) unconditional formula.

Parameters:
Returns:

[source, target, freq] in nats, NaN on the diagonal.

Return type:

ndarray, shape (n_channels, n_channels, n_freqs)