dirconn.RPDC#

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

Renormalised partial directed coherence (Schelter et al. 2009), a predictive measure.

values[source, target, f] is lambda of the influence of source on target: the squared real and imaginary part of the AR polynomial entry Abar[target, source](f), weighted by the inverse of their asymptotic covariance (see dirconn.methods.spectral.rpdc_from_coefs()). In the paper’s indices (i target, j source) it is lambda_ij(f), stored at values[j, i, f]. Unlike PDC it is not normalised over the targets; it measures how far the direct influence at f is from zero relative to its estimation error, so it does not depend on the scale of the channels. With a real connection lambda tends to a value that does not depend on the recording length; N lambda is the Wald statistic that dirconn.analytic_rpdc_test() compares with the chi-square distribution.

lambda resolves frequency only from order 3 on. The real and imaginary part are two linear combinations of the order coefficients of the pair, and a Wald statistic does not change under an invertible linear map: at order 1 lambda is the same at every frequency, and at order 2 it is the same at every frequency other than 0 and the Nyquist frequency, where it equals the joint test of both lags in the time domain.

The model is fitted by ordinary least squares only: the asymptotic covariance holds for that fit, so there is no ridge and rPDC suits a few channels (regions or selected sensors), not a high-dimensional sensor-level fit. Like every MVAR measure it is affected by volume conduction and leakage: an instantaneous mixture of sources changes the coefficients.

Parameters:
  • order – As for DTF.

  • max_order – As for DTF.

  • n_freqs – As for DTF.

  • fmax – As for DTF.

  • freqs – As for DTF.

  • demean – As for DTF.

  • n_folds – As for DTF.

  • check_order_stability – As for DTF.

  • check_whiteness – As for DTF.

__init__(order: int | str = 'bic', max_order: int = 10, n_freqs: int = 128, fmax: float | None = None, freqs: Any = None, demean: bool = True, n_folds: int = 5, check_order_stability: bool = True, check_whiteness: 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

demean

fmax

freqs

info

max_order

n_folds

n_freqs

order

ridge