Skip to content

Follow-up: exact correct_mc random-symbol distribution fitting #147

Closed

Description

@suraj-ranganath

🤖 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.

Activity

  1. claude commented on Jun 6, 2026

    @claude
    Contributor

    🤖 # Research

    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.

    Relevant code

    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.

    Suggested action for a maintainer:

    1. Land Phase 7: Remaining long-tail core helpers and missing pop_* wrappers #138 with the standalone correct_mc estimator.
    2. Close this issue as "design decision: defer exact RS-fit until bootstat/newtimef significance is scoped".
    3. 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.

  2. suraj-ranganath commented on Jun 7, 2026

    @suraj-ranganath
    MemberAuthor

    🤖 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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions