Add epochs.regress_evoked function - #14238
Draft
wmvanvliet wants to merge 1 commit into
Draft
Conversation
wmvanvliet
requested review from
agramfort,
drammock,
larsoner and
mscheltienne
as code owners
August 28, 2026 11:37
wmvanvliet
marked this pull request as draft
August 28, 2026 11:37
Contributor
Author
Contributor
Author
|
We're holding off on this for now until it is used in a publication. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove ERF from single trial using ordinary least-squares regression i.e., minimizes
the sum of squared differences between the predicted and observed trial
signal.
[1] Fit ERP waveforms to single trial
[2] Use β coefficient, estimate the presence of ERP in the data
[3] Subtract only the β ERP from the single trial (not the full average)
To minimize contamination of induced spectral estimates by phase-locked
activity, we applied regression-based ERP removal to each trial prior to
spectral decomposition. Unlike the subtraction of the averaged evoked
response implemented in mne-ython
(https://mne.tools/stable/generated/mne.Epochs.html#mne.Epochs.subtract_evoked)
, this regression models the trial-specific contribution of the ERP, which
preserves the non-phase-locked (induced) oscillatory activity while
removing the shared evoked component (e.g. Grandchamp & Delorme, 2011; Cohen,
2014). This approach is particularly important when computing 1/f and
oscillatory components using IRASA, as residual ERP may bias the estimation
of aperiodic activity and oscillatory peaks (Makeig et al., 2004).
Grandchamp, R., & Delorme, A. (2011). Single-trial normalization for event-related
spectral decomposition reduces sensitivity to noisy trials.
Frontiers in psychology, 2, 236.
Makeig, S., Debener, S., Onton, J., & Delorme, A. (2004). Mining event-related
brain dynamics. Trends in cognitive sciences, 8(5), 204-210.
Cohen, M. X. (2014). Analyzing neural time series data:
theory and practice. MIT press.