-
Notifications
You must be signed in to change notification settings - Fork 43
Modelate Data
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.
- 'cross_correlation'
- Pearson Correlation
- 'pearson_correlation'
- Threshold = 0.7
- Does not require frequency bands.
- 'pearson_correlation'
- Squared Coherence
- 'squared_coherence'
- Threshold = 0.65
- Requires frequency bands.
- 'squared_coherence'
- Imaginary Coherence
- 'imag_coherence'
- Threshold = 0.4
- Requires frequency bands.
- 'imag_coherence'
- Corrected Cross Correlation
- 'corr_cross_correlation'
- Threshold = 0.1
- Does not require frequency bands.
- 'corr_cross_correlation'
- Weighted Phase Lag Index (WPLI)
- 'wpli'
- Threshold = 0.45
- Requires frequency bands.
- 'wpli'
- Phase Locking Value (PLV)
- 'plv'
- Threshold = 0.8
- Requires frequency bands.
- 'plv'
- Phase Lag Index (PLI)
- 'pli'
- Threshold = 0.1
- Does not require frequency bands.
- 'pli_bands'
- Threshold = 0.1
- Requires frequency bands.
- 'pli'
- Directed Transfer Function (DTF)
- 'dtf'
- Threshold = 0.3
- Requires frequency bands.
- 'dtf'
- Power Spectrum
- 'power_spectrum'
- Threshold = includes the percentage highest connectivity value channels (default 0.25=25%).
- Requires frequency bands.
- 'power_spectrum'
- Spectral Entropy
- 'spectral_entropy'
- Threshold = includes the percentage highest connectivity value channels (default 0.25=25%).
- Requires frequency bands.
- 'spectral_entropy'
- Shannon Entropy
- 'shannon_entropy'
- Threshold = includes the percentage highest connectivity value channels (default 0.25=25%).
- Does not require frequency bands.
- 'shannon_entropy'
graphs, connectivity_matrix = G.modelate(window_size, connectivity, bands = [None], threshold = [None])
Parameters:
-
window_size
: Required | int or listDesired window size, can be an integer, e.g.(2) or time intervals, e.g. [0,2].
-
connectivity
: Required | strConnectivity measure to compute. One of the listed in the section above.
-
bands
: Required | list of strIt 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 | floatUser specific threshold used to determine if an edge exists within two channels from the connectivity value.
Returns:
-
graphs
: dict of NetworkX graph-like objectsDictionary 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'])