Skip to content

Add epochs.regress_evoked function - #14238

Draft
wmvanvliet wants to merge 1 commit into
mne-tools:mainfrom
wmvanvliet:regress-evoked
Draft

Add epochs.regress_evoked function#14238
wmvanvliet wants to merge 1 commit into
mne-tools:mainfrom
wmvanvliet:regress-evoked

Conversation

@wmvanvliet

Copy link
Copy Markdown
Contributor

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)

        epochi​(t)=βi​⋅ERP(t)+εi​(t)

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.

@wmvanvliet
wmvanvliet marked this pull request as draft August 28, 2026 11:37
@wmvanvliet

Copy link
Copy Markdown
Contributor Author

@virvw

@wmvanvliet wmvanvliet added the ENH label Aug 28, 2026
@wmvanvliet

Copy link
Copy Markdown
Contributor Author

We're holding off on this for now until it is used in a publication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant