mne_connectivity.wsmi#
- mne_connectivity.wsmi(data, kernel, tau, indices='lower', 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.Epochsobject or array-like data.- kernel
int Pattern length (symbol dimension) for symbolic analysis. Must be > 1. Values > 7 may require significant memory.
- tau
int Time delay (lag; in samples) between consecutive pattern elements. Must be > 0.
- indices
tupleof array_like |'lower'|'upper'|'all' The indices of channels to compute connectivity between. If a tuple, then must contain two array-likes, where the first array represents the channel indices of the seeds, and the second array represents the channel indices of the targets. See the notes section for more information. If
'lower', compute the lower-triangular part of the connectivity matrix. If'upper', compute the upper-triangular part of the connectivity matrix. If'all', compute all connections. Default is'lower'.- sfreq
float|None The sampling frequency. Required if
datais an array-like.- namesarray_like |
None A list of names associated with the signals in
data. IfNoneanddatais anmne.Epochsobject, the names indatawill be used. Ifdatais an array-like, the names will be a list of indices of the number of nodes.- tmin
float|None Time to start connectivity estimation. Note: when
datais an array-like, the first sample is assumed to be at time 0. Formne.Epochs, the time information contained in the object is used to compute the time indices. IfNone, uses the first sample.- tmax
float|None Time to end connectivity estimation. Note: when
datais an array-like, the first sample is assumed to be at time 0. Formne.Epochs, the time information contained in the object is used to compute the time indices. IfNone, uses the last sample.- anti_aliasing
'auto'| bool Controls anti-aliasing low-pass filtering before symbolic transformation.
'auto'(default): Smart detection based ondatatype and preprocessing. For array inputs, always applies filtering. Formne.Epochs, checksinfo['lowpass']to determine if data is already appropriately filtered. Only applies filtering if existing lowpass > required frequency.True: Always apply an anti-aliasing filter atsfreq / kernel / tauHz.False: Never apply filtering. Use only if you have already applied appropriate low-pass filtering to your data.
Warning
Setting to
Falsemay 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. IfFalse, computes standard SMI without weights.- averagebool
Whether to average connectivity across epochs. If
True, returns connectivity averaged over epochs. IfFalse(default), returns connectivity for each epoch separately.- verbosebool |
str|int|None If not
None, override default verbose level (seemne.verbose()for more info). If used, it should be passed as a keyword-argument only.
- dataarray_like, shape (n_epochs, n_signals, n_times) |
- Returns:
- conninstance of
ConnectivityorEpochConnectivity Computed connectivity measure. If
average=True, returns aConnectivityinstance with connectivity averaged across epochs. Ifaverage=False, returns anEpochConnectivityinstance with connectivity for each epoch.
- conninstance of
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:
Symbolic transformation of time series using ordinal patterns
Computation of mutual information between symbolic sequences
Weighting based on pattern distance for enhanced sensitivity
If connectivity for all possible connections is desired, we can save time and memory by only computing and storing the lower- (or upper-) triangular part of the connectivity matrix. When the full set of connectivity values is needed, the missing values can be inferred based on what has been computed. See the notes section of the
get_data()method in the connectivity containers for more information.If one is only interested in the connectivity between some signals, the
indicesparameter can be specified as a tuple of array-likes. For example, to compute the connectivity between the signal with index 0 and the signals with indices 2, 3, and 4 (a total of 3 connections) one can use the following:indices = (np.array([0, 0, 0]), # seed indices np.array([2, 3, 4])) # target indices
Added in version 0.8.
References
Examples using mne_connectivity.wsmi#
Compute connectivity using weighted symbolic mutual information (wSMI)