PhaseSlopeIndex.jl

This is a Julia implementation of the Phase Slope Index method. Please refer to http://doc.ml.tu-berlin.de/causality/ for more information.

Outline

Functions

The only exported function is data2psi:

PhaseSlopeIndex.data2psiFunction
data2psi(data, seglen ; segshift, eplen, freqlist, method,
                        nboot, segave, subave, detrend)

calculates phase slope index (PSI)

Arguments

  • data::AbstractArray: NxM array for N data points in M channels
  • seglen::Integer: segment length (determines the frequency resolution). If defining freqlist, seglen must be the same as sampling frequency.

optional arguments

  • segshift::Integer: number of bins by which neighboring segments are shifted (default is seglen / 2)
  • eplen::Integer: length of epochs (default is number of samples)
  • freqlist::AbstractArray: a UnitRange or 2D-Array where each column is a frequency band (default is full range). Note that the DC component (0th frequency of FFT) is discarded and the values in the freqlist shall be Integer Hz values.
  • method::String: standard deviation estimation method (default is "jackknife")
  • subave::Bool: if true, subtract average across Cross Spectra segments (default is false)
  • segave::Bool: if true, average across Cross Spectra segments (default is true)
  • nboot::Integer: number of bootstrap resampling iterations (default is 100)
  • detrend::Bool: if true, performs a 0th-order detrend across raw segments (default is false)
  • window::Function: window function with interval length as sole necessary argument (default is Hanning)
  • verbose::Bool: if true, warnings and info logs would be echoed. (default is false)

Returns

  • psi::AbstractArray: Phase Slope Index with shape (channel, channel, frequency bands)
  • psi_std::AbstractArray: PSI estimated standard deviation with shape (channel, channel, frequency bands)
source

Citation

Please cite the following paper if you use this code in published work:

Nolte, G., Ziehe, A., Nikulin, V., Schlögl, A., Krämer, N., Brismar, T., & Müller, K.R. (2008), Robustly Estimating the Flow Direction of Information in Complex Physical Systems, Phys. Rev. Lett., 100, 234101.

Acknowledgement

This work was funded by the German Federal Ministry of Education and Research (BMBF) in the project ALICE III under grant ref. 01IS18049B.