You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Follow-up: exact correct_mc random-symbol distribution fitting #147
🤖 Follow-up from Phase 7 (#138) of epic #131.\n\nRows covered: correct_mc, correctfit, rsadjust, rsfit, rsget, rspdfsolv, rspfunc.\n\nScope: decide whether exact EEGLAB Ramberg-Schmeiser/random-symbol distribution fitting is needed beyond EEGPrep's current standalone neighboring-bin correct_mc estimator; if yes, port it with deterministic numerical parity tests.\n\nNon-goal: do not replace the current standalone correct_mc path without proving parity and workflow value.
correct_mc is an EEGLAB command-line diagnostic that estimates the effective number of independent time-frequency estimates so a researcher can pick an honest Bonferroni denominator for newtimef plots. Internally it computes lag-1 correlations across channels per frequency, then calls rsfit (Ramberg-Schmeiser 4-parameter percentile fit) to get the p-value that "0" lies inside that correlation distribution. The seven rows in this issue (correct_mc, correctfit, rsadjust, rsfit, rsget, rspdfsolv, rspfunc) form one tightly-coupled RS-fit stack used in exactly two EEGLAB call sites: correct_mc itself (not menu-reachable) and bootstat (the distfit="on" smoothing path used by newtimef/timef/crossf bootstrap significance).
EEGPrep currently has neither call site. newtimef.py is a deterministic ERSP/ITC core with no bootstrap path, and pop_newtimef._reject_unsupported_options raises NotImplementedError for alpha != 0, erspboot, itcboot, rboot, pboot. The "current standalone neighboring-bin correct_mc estimator" referenced by this issue is the Phase 7 deliverable from #138, which is still open — no Phase 7 PR exists on origin.
EEGLAB upstream: functions/timefreqfunc/correct_mc.m, rsfit.m, bootstat.m (only consumers of the RS stack)
Proposed Approach
Scope decision, not a small fix — declining to auto-open a PR. Recommendation: do not port the RS-fit stack solely to back correct_mc; defer it to whenever bootstat-equivalent significance is scoped.
Rationale: correct_mc's user-observable output is the integer ncorrect used as a Bonferroni denominator; the RS-fit p-value is only an internal threshold test (pval < 0.05/numel(pval)) to detect when lag-1 correlation has dropped to "uncorrelated". A permutation or Fisher-z test on per-channel lag-1 correlations yields the same operational ncorrect without porting six MATLAB files. The Phase 7 standalone neighboring-bin estimator (once merged from #138) is the right scope for this row — it gives EEGLAB users the workflow value (a Bonferroni denominator) without numerical RS parity.
Where exact RS numerics actually matter is bootstat's distfit="on" path in newtimef/timef/crossf, because the tail of a fitted RS distribution is what users read off significance masks. That belongs to a separate bootstat/alpha follow-up, not to this correct_mc row.
Close this issue as "design decision: defer exact RS-fit until bootstat/newtimef significance is scoped".
Open a new follow-up tied to the bootstat row when alpha/erspboot/itcboot support is planned for newtimef; that follow-up would port rsfit/rsget/rspdfsolv/rspfunc/rsadjust/correctfit with deterministic MATLAB parity tests.
Stopping here per the fix-issue skill — design questions and >100-line scope changes do not get an auto-PR.
🤖 Resolved by the work now included in PR #152. Closing this constituent phase/follow-up issue now; parent epic #131 remains open until the epic PR merges.
Activity
claude commentedon Jun 6, 2026
🤖 # Research
correct_mcis an EEGLAB command-line diagnostic that estimates the effective number of independent time-frequency estimates so a researcher can pick an honest Bonferroni denominator fornewtimefplots. Internally it computes lag-1 correlations across channels per frequency, then callsrsfit(Ramberg-Schmeiser 4-parameter percentile fit) to get the p-value that "0" lies inside that correlation distribution. The seven rows in this issue (correct_mc,correctfit,rsadjust,rsfit,rsget,rspdfsolv,rspfunc) form one tightly-coupled RS-fit stack used in exactly two EEGLAB call sites:correct_mcitself (not menu-reachable) andbootstat(thedistfit="on"smoothing path used bynewtimef/timef/crossfbootstrap significance).EEGPrep currently has neither call site.
newtimef.pyis a deterministic ERSP/ITC core with no bootstrap path, andpop_newtimef._reject_unsupported_optionsraisesNotImplementedErrorforalpha != 0,erspboot,itcboot,rboot,pboot. The "current standalone neighboring-bin correct_mc estimator" referenced by this issue is the Phase 7 deliverable from #138, which is still open — no Phase 7 PR exists onorigin.Relevant code
src/eegprep/functions/timefreqfunc/newtimef.py#L26-L86— current deterministic ERSP/ITC core, no significance pathsrc/eegprep/functions/popfunc/pop_newtimef.py#L227-L234— bootstrap options rejected withNotImplementedError.notes/eeglab-migration-gap-audit.mdL196-L202, L548-L552 — these rows listed undertimefreqfunclong-tailfunctions/timefreqfunc/correct_mc.m,rsfit.m,bootstat.m(only consumers of the RS stack)Proposed Approach
Scope decision, not a small fix — declining to auto-open a PR. Recommendation: do not port the RS-fit stack solely to back
correct_mc; defer it to wheneverbootstat-equivalent significance is scoped.Rationale:
correct_mc's user-observable output is the integerncorrectused as a Bonferroni denominator; the RS-fit p-value is only an internal threshold test (pval < 0.05/numel(pval)) to detect when lag-1 correlation has dropped to "uncorrelated". A permutation or Fisher-z test on per-channel lag-1 correlations yields the same operationalncorrectwithout porting six MATLAB files. The Phase 7 standalone neighboring-bin estimator (once merged from #138) is the right scope for this row — it gives EEGLAB users the workflow value (a Bonferroni denominator) without numerical RS parity.Where exact RS numerics actually matter is
bootstat'sdistfit="on"path innewtimef/timef/crossf, because the tail of a fitted RS distribution is what users read off significance masks. That belongs to a separatebootstat/alpha follow-up, not to thiscorrect_mcrow.Suggested action for a maintainer:
bootstatrow whenalpha/erspboot/itcbootsupport is planned fornewtimef; that follow-up would portrsfit/rsget/rspdfsolv/rspfunc/rsadjust/correctfitwith deterministic MATLAB parity tests.Stopping here per the fix-issue skill — design questions and >100-line scope changes do not get an auto-PR.
suraj-ranganath commentedon Jun 7, 2026
🤖 Resolved by the work now included in PR #152. Closing this constituent phase/follow-up issue now; parent epic #131 remains open until the epic PR merges.