Skip to content

Modelate Data

Pedro Chazarra Grande edited this page Jun 24, 2021 · 7 revisions

Compute frequency and time-frequency domain connectivity measures. The different available connectivity measures in EEGraph with their default parameters.

Connectivity Measures:

  • Cross Correlation
    • 'cross_correlation'
      • Threshold = 0.5
      • Does not require frequency bands.
  • Pearson Correlation
    • 'pearson_correlation'
      • Threshold = 0.7
      • Does not require frequency bands.
  • Squared Coherence
    • 'squared_coherence'
      • Threshold = 0.65
      • Requires frequency bands.
  • Imaginary Coherence
    • 'imag_coherence'
      • Threshold = 0.4
      • Requires frequency bands.
  • Corrected Cross Correlation
    • 'corr_cross_correlation'
      • Threshold = 0.1
      • Does not require frequency bands.
  • Weighted Phase Lag Index (WPLI)
    • 'wpli'
      • Threshold = 0.45
      • Requires frequency bands.
  • Phase Locking Value (PLV)
    • 'plv'
      • Threshold = 0.8
      • Requires frequency bands.
  • Phase Lag Index (PLI)
    • 'pli'
      • Threshold = 0.1
      • Does not require frequency bands.
    • 'pli_bands'
      • Threshold = 0.1
      • Requires frequency bands.
  • Directed Transfer Function (DTF)
    • 'dtf'
      • Threshold = 0.3
      • Requires frequency bands.
  • Power Spectrum
    • 'power_spectrum'
      • Threshold = includes the percentage highest connectivity value channels (default 0.25=25%).
      • Requires frequency bands.
  • Spectral Entropy
    • 'spectral_entropy'
      • Threshold = includes the percentage highest connectivity value channels (default 0.25=25%).
      • Requires frequency bands.
  • Shannon Entropy
    • 'shannon_entropy'
      • Threshold = includes the percentage highest connectivity value channels (default 0.25=25%).
      • Does not require frequency bands.

 graphs, connectivity_matrix = G.modelate(window_size, connectivity, bands = [None], threshold = [None])

Parameters:

  • window_size: Required | int or list

    Desired window size, can be an integer, e.g.(2) or time intervals, e.g. [0,2].

  • connectivity: Required | str

    Connectivity measure to compute. One of the listed in the section above.

  • bands: Required | list of str

    It is only required if connectivity measure needs it. Desired frequency bands to be used in the analysis, e.g. ['delta','theta','alpha','beta','gamma'].

  • threshold: Optional - Default = Specific to Connectivity Measure | float

    User specific threshold used to determine if an edge exists within two channels from the connectivity value.

Returns:

  • graphs: dict of NetworkX graph-like objects

    Dictionary containing all the generated NetworkX graphs.

  • connectivity_matrix: numpy.ndarray (G x N x N)

    Connectivity matrices from resulting graphs. G is the number of graphs and N is the number of channels.


Example without Frequency Bands:

   G = eegraph.Graph()
   G.load_data(path= "eeg_sample_1.edf", exclude = ['EEG TAntI1-TAntI', 'EEG TAntD1-TAntD', 'EEG EKG1-EKG2'])`
   graphs, connectivity_matrix = G.modelate(window_size = 2, connectivity = 'pearson_correlation')

Example with Frequency Bands:

   G = eegraph.Graph()
   G.load_data(path= "eeg_sample_1.edf", exclude = ['EEG TAntI1-TAntI', 'EEG TAntD1-TAntD', 'EEG EKG1-EKG2'])`
   graphs, connectivity_matrix = G.modelate(window_size = 2, connectivity = 'squared_coherence', bands = ['delta','theta','alpha'])
Clone this wiki locally