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, targetYand the other channelsZof the model (all other channels whenconditional, none otherwise), Geweke’s (1984) conditional measure is the unconditional spectral causality from(X, Z*)toY*, 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^Rthe innovation covariance of the reduced model,Psi = H_R^-1 H_{(Y,Z),:}the filter from the full innovations to the reduced ones andSigma_{SS|Y}the partial covariance of the full innovations ofSgiven that ofY. The mean offover the whole unit circle is the time-domain value ofstate_space_gc(); for two channelsfis Geweke’s (1982) unconditional formula.- Parameters:
coefs – As for
state_space_gc().noise_cov – As for
state_space_gc().conditional – As for
state_space_gc().freqs (array_like) – Frequencies in Hz.
sfreq (float) – Sampling frequency in Hz.
- Returns:
[source, target, freq]in nats, NaN on the diagonal.- Return type:
ndarray, shape (n_channels, n_channels, n_freqs)