dirconn.SSGC#

class dirconn.SSGC(order: int | str = 'bic', max_order: int = 10, n_freqs: int = 128, fmax: float | None = None, freqs: Any = None, ridge: float = 0.0, demean: bool = True, n_folds: int = 5, check_order_stability: bool = True, check_whiteness: bool = True, conditional: bool = True)#

Spectral Granger causality from the state-space form of the VAR (Barnett and Seth 2015).

values[i, j, f] is the Geweke spectral Granger causality from channel i to channel j at frequency f, in nats. One VAR model of all channels is fitted; written in innovations form, it gives every reduced model exactly by one discrete algebraic Riccati equation per conditioning set (see dirconn.methods.statespace), so no reduced model is refitted and no non-parametric spectral factorisation is needed. With conditional=True (default) the influence of i on j is conditioned on all other channels, f_{i->j|rest}(f); with conditional=False each pair is judged from its bivariate subprocess of the same fit, which for two channels is Geweke’s (1982) formula.

The mean over the whole unit circle (the trapezoid mean over the default grid from 0 to the Nyquist frequency) is the time-domain value of GC(method="state_space"). The values do not depend on the scale of the channels. Unlike MTGC the measure is parametric and conditional, so it suits short segments and more than two channels; like every MVAR measure it needs a stationary, well-specified model, and an unstable fit raises ValueError.

Parameters:
  • order – As for DTF. With ridge > 0 the penalised fit and its residual covariance define the model.

  • max_order – As for DTF. With ridge > 0 the penalised fit and its residual covariance define the model.

  • n_freqs – As for DTF. With ridge > 0 the penalised fit and its residual covariance define the model.

  • fmax – As for DTF. With ridge > 0 the penalised fit and its residual covariance define the model.

  • freqs – As for DTF. With ridge > 0 the penalised fit and its residual covariance define the model.

  • ridge – As for DTF. With ridge > 0 the penalised fit and its residual covariance define the model.

  • demean – As for DTF. With ridge > 0 the penalised fit and its residual covariance define the model.

  • n_folds – As for DTF. With ridge > 0 the penalised fit and its residual covariance define the model.

  • conditional (bool) – Condition on all other channels (default) or judge channel pairs separately. Costs one Riccati equation per channel, or one per pair and per channel.

  • check_order_stability (bool) – As for DTF; the order-stability check compares with least-squares GC refits in the same mode (conditional or pairwise).

  • check_whiteness (bool) – As for DTF; the order-stability check compares with least-squares GC refits in the same mode (conditional or pairwise).

__init__(order: int | str = 'bic', max_order: int = 10, n_freqs: int = 128, fmax: float | None = None, freqs: Any = None, ridge: float = 0.0, demean: bool = True, n_folds: int = 5, check_order_stability: bool = True, check_whiteness: bool = True, conditional: bool = True) → None#

Methods

__init__([order, max_order, n_freqs, fmax, ...])

fit(data)

Estimate directed connectivity.

get_params()

Return the constructor parameters as a dictionary.

Attributes

check_order_stability

check_whiteness

conditional

demean

fmax

freqs

info

max_order

n_folds

n_freqs

order

ridge