mne_connectivity.wsmi#

mne_connectivity.wsmi(data, kernel, tau, indices=None, sfreq=None, names=None, tmin=None, tmax=None, anti_aliasing='auto', weighted=True, average=False, verbose=None)[source]#

Compute weighted symbolic mutual information (wSMI).

Parameters:
dataarray_like, shape (n_epochs, n_signals, n_times) | Epochs

The data from which to compute connectivity. Can be an mne.Epochs object or array-like data.

kernelint

Pattern length (symbol dimension) for symbolic analysis. Must be > 1. Values > 7 may require significant memory.

tauint

Time delay (lag; in samples) between consecutive pattern elements. Must be > 0.

indicestuple of array_like | None

Two array-likes with indices of connections for which to compute connectivity. If None, all connections are computed (lower triangular matrix). For example, to compute connectivity between channels 0 and 2, and between channels 1 and 3, use indices = (np.array([0, 1]), np.array([2, 3])).

sfreqfloat | None

The sampling frequency. Required if data is an array-like.

namesarray_like | None

A list of names associated with the signals in data. If None and data is an mne.Epochs object, the names in data will be used. If data is an array-like, the names will be a list of indices of the number of nodes.

tminfloat | None

Time to start connectivity estimation. Note: when data is an array-like, the first sample is assumed to be at time 0. For mne.Epochs, the time information contained in the object is used to compute the time indices. If None, uses the first sample.

tmaxfloat | None

Time to end connectivity estimation. Note: when data is an array-like, the first sample is assumed to be at time 0. For mne.Epochs, the time information contained in the object is used to compute the time indices. If None, uses the last sample.

anti_aliasing'auto' | bool

Controls anti-aliasing low-pass filtering before symbolic transformation.

  • 'auto' (default): Smart detection based on data type and preprocessing. For array inputs, always applies filtering. For mne.Epochs, checks info['lowpass'] to determine if data is already appropriately filtered. Only applies filtering if existing lowpass > required frequency.

  • True: Always apply an anti-aliasing filter at sfreq / kernel / tau Hz.

  • False: Never apply filtering. Use only if you have already applied appropriate low-pass filtering to your data.

Warning

Setting to False may produce unreliable results if the effective sampling rate (sfreq / tau) violates the Nyquist criterion for the spectral content of your data.

weightedbool

Whether to compute weighted SMI (wSMI) or standard SMI. If True (default), computes wSMI with distance-based weights. If False, computes standard SMI without weights.

averagebool

Whether to average connectivity across epochs. If True, returns connectivity averaged over epochs. If False (default), returns connectivity for each epoch separately.

verbosebool | str | int | None

Control verbosity of the logging output. If None, use the default verbosity level. See the logging documentation and mne.verbose() for details. Should only be passed as a keyword argument.

Returns:
conninstance of Connectivity or EpochConnectivity

Computed connectivity measure. If average=True, returns a Connectivity instance with connectivity averaged across epochs. If average=False, returns an EpochConnectivity instance with connectivity for each epoch.

Notes

The weighted Symbolic Mutual Information (wSMI) is a connectivity measure that quantifies non-linear statistical dependencies between time series based on symbolic dynamics [1].

The method involves:

  1. Symbolic transformation of time series using ordinal patterns

  2. Computation of mutual information between symbolic sequences

  3. Weighting based on pattern distance for enhanced sensitivity

References

Examples using mne_connectivity.wsmi#

Compute connectivity using weighted symbolic mutual information (wSMI)

Compute connectivity using weighted symbolic mutual information (wSMI)