fooof/specparam version: not particularly relevant but >1.1 on Python
Prior spectral analyses made with MNE >1.8
Hello,
I know this is not directly MNE-related but I believe this community is the most likely to be able to answer.
Our study involves an exploratory “quantitative i/M/EEG” investigation to test if oscillatory power within each canonical frequency band significantly differs between conditions (within a single subject for this example). I am calculating power spectra using MNE and then fooof/specparam to produce periodic and aperiodic metrics without meeting any technical issues.
Minimal code:
bands = specparam.Bands({'delta': [1, 4],
'theta': [4, 8],
'alpha': [8, 13],
'beta' : [13, 30],
'gamma1': [30, 70],
'gamma2': [70, 120]})
psd = epochs.compute_psd().average()
spectrum, freqs = psd.get_data(return_freqs=True)
fg = specparam.SpectralModel(peak_width_limits=(1, 12), max_n_peaks=8, min_peak_height=0, peak_threshold=2.,aperiodic_mode='knee', verbose=True)
fg.fit(freqs, spectrum, [1, 150])
fg.to_df(bands)
My real problem is what to do with the results from the periodic components. In some frequency bands (especially when it is not alpha), a peak is not consistently detected in all trials (when below threshold) and no “peak metrics” are calculated. So my dataframe contains a lot of “NA” and I wonder how I can compare periodic peak height between my two conditions when some information is censored/thresholded. What makes it more difficult is that I don’t know the absolute value of the cutoff (in theory, it is supposed to be twice the SD of the noise floor) which prevents me from doing statistical tests tailored to “censored” data. The same problem would arise if I would be to compare conditions across subjects vs. across trials.
Where do I go from there to do meaningful statistics? Have you been in this situation?
Some publications appear to exclude subjects without peaks, or not to have this issue (esp. when focusing on alpha which is usually consistently present in some settings). Should I significantly toggle with the parameters of the specparam model?