mne_connectivity.phase_slope_index#

mne_connectivity.phase_slope_index(data, names=None, indices=None, sfreq=6.283185307179586, mode='multitaper', fmin=None, fmax=inf, tmin=None, tmax=None, mt_bandwidth=None, mt_adaptive=False, mt_low_bias=True, cwt_freqs=None, cwt_n_cycles=7, block_size=1000, n_jobs=1, verbose=None)[source]#

Compute the Phase Slope Index (PSI) connectivity measure.

The PSI is an effective connectivity measure, i.e., a measure which can give an indication of the direction of the information flow (causality). For two time series, and one computes the PSI between the first and the second time series as follows

indices = (np.array([0]), np.array([1])) psi = phase_slope_index(data, indices=indices, …)

A positive value means that time series 0 is ahead of time series 1 and a negative value means the opposite.

The PSI is computed from the coherency (see spectral_connectivity_epochs), details can be found in [1].

Parameters:
dataarray_like, shape=(n_epochs, n_signals, n_times)

Can also be a list/generator of array, shape =(n_signals, n_times); list/generator of SourceEstimate; or Epochs. The data from which to compute connectivity. Note that it is also possible to combine multiple signals by providing a list of tuples, e.g., data = [(arr_0, stc_0), (arr_1, stc_1), (arr_2, stc_2)], corresponds to 3 epochs, and arr_* could be an array with the same number of time points as stc_*.

nameslist | np.ndarray | None

The names of the nodes of the dataset used to compute connectivity. If ‘None’ (default), then names will be a list of integers from 0 to n_nodes. If a list of names, then it must be equal in length to n_nodes.

indicestuple of array | None

Two arrays with indices of connections for which to compute connectivity. If None, all connections are computed.

sfreqfloat

The sampling frequency.

modestr

Spectrum estimation mode can be either: ‘multitaper’, ‘fourier’, or ‘cwt_morlet’.

fminfloat | tuple of float

The lower frequency of interest. Multiple bands are defined using a tuple, e.g., (8., 20.) for two bands with 8Hz and 20Hz lower freq. If None the frequency corresponding to an epoch length of 5 cycles is used.

fmaxfloat | tuple of float

The upper frequency of interest. Multiple bands are dedined using a tuple, e.g. (13., 30.) for two band with 13Hz and 30Hz upper freq.

tminfloat | None

Time to start connectivity estimation.

tmaxfloat | None

Time to end connectivity estimation.

mt_bandwidthfloat | None

The bandwidth of the multitaper windowing function in Hz. Only used in ‘multitaper’ mode.

mt_adaptivebool

Use adaptive weights to combine the tapered spectra into PSD. Only used in ‘multitaper’ mode.

mt_low_biasbool

Only use tapers with more than 90 percent spectral concentration within bandwidth. Only used in ‘multitaper’ mode.

cwt_freqsarray

Array of frequencies of interest. Only used in ‘cwt_morlet’ mode.

cwt_n_cyclesfloat | array of float

Number of cycles. Fixed number or one per frequency. Only used in ‘cwt_morlet’ mode.

block_sizeint

How many connections to compute at once (higher numbers are faster but require more memory).

n_jobsint

How many epochs to process in parallel.

verbosebool, str, int, or None

If not None, override default verbose level (see mne.verbose() for more info). If used, it should be passed as a keyword-argument only.

Returns:
conninstance of Connectivity

Computed connectivity measure(s). Either a SpectralConnnectivity, or SpectroTemporalConnectivity container. The shape of each array is either (n_signals ** 2, n_bands) mode: ‘multitaper’ or ‘fourier’ (n_signals ** 2, n_bands, n_times) mode: ‘cwt_morlet’ when “indices” is None, or (n_con, n_bands) mode: ‘multitaper’ or ‘fourier’ (n_con, n_bands, n_times) mode: ‘cwt_morlet’ when “indices” is specified and “n_con = len(indices[0])”.

References

Examples using mne_connectivity.phase_slope_index#

Comparison of coherency-based methods

Comparison of coherency-based methods

Compute Phase Slope Index (PSI) in source space for a visual stimulus

Compute Phase Slope Index (PSI) in source space for a visual stimulus