[Timefreq] Port correct_mc random-symbol fitting - #154
Conversation
|
Claude finished @suraj-ranganath's task in 3m 29s —— View job PR Review: [Timefreq] Port correct_mc random-symbol fitting
Code review
BlockingNone. Important
The sign of # rsadjust.py:30
if skew * (c - 2.0 * a * b + 2.0 * a**3) < 0:
l2 = -l2When Suggested fix (align with if skew * (c - 3.0 * a * b + 2.0 * a**3) < 0:
l2 = -l2Please confirm against NitsNone. Test gaps
Suggested test: add an asymmetric case with EEGLAB parity notes
|
|
🤖 Specification Problem: correct_mc previously returned standalone neighboring-bin p-values that did not use EEGLAB's Ramberg-Schmeiser fitting path, leaving the issue #147 rows partial/deferred. Approach: add standalone ports of rsfit, rsadjust, rsget, rspdfsolv, rspfunc, and correctfit under functions/timefreqfunc; wire correct_mc to rsfit(correlations, 0) while preserving its existing input/output workflow; update exports, docs, matrix rows, and implementation notes. Key code: rsfit computes sample moments, solves lambda3/lambda4 with rspdfsolv, adjusts lambda1/lambda2 through rsadjust, then calls rsget for the fitted cumulative probability. rsadjust intentionally preserves EEGLAB rsadjust.m's C - 2AB + 2A^3 lambda2 sign convention. Tests: focused tests cover correct_mc delegation, analytic RS cases, asymmetric rsadjust parity behavior, correctfit gamma-parameter correction, the full time-frequency statistics file, matrix validation, ruff, ty, and PR-scope pre-commit. MATLAB parity coverage is present and skip-aware when matlab.engine is unavailable locally. |
Port the EEGLAB Ramberg-Schmeiser helpers used by correct_mc and replace the temporary neighboring-bin p-value estimator with standalone rsfit. Bundle correctfit with the same distribution-fitting family, without expanding bootstat distfit. Part of epic #131 and stacked under PR #152.
Closes #147