Fix Llobet expected-violations formula in sliding RP metric#4682
Open
oliche wants to merge 1 commit into
Open
Conversation
_compute_violations used Ve = 2*tau/D * Nc*(Nb+Nc), overestimating expected violations. Corrected to the Llobet et al. (2022) form Ve = 2*tau/D * Nc*(Nb + (Nc-1)/2), matching the reference slidingRefractory implementation. Also extend the default contamination grid to include 35% (arange(0.5, 35.5, 0.5)) and add a unit test.
Contributor
Author
|
The original repo fix is here for reference: SteinmetzLab/slidingRefractory#8 |
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.
Fix Llobet expected-violations formula in the sliding RP metric
_compute_violationscomputed expected violations asVe = 2·τ/D · Nc·N(i.e.Nc·(Nb + Nc)), which overestimatesVeand inflates the contamination confidence. Corrected to the Llobet et al. (2022) form used by the reference implementation:Also extends the default contamination grid to include 35 % (
np.arange(0.5, 35.5, 0.5), previously stopped at 34.5 %) and adds a unit test for_compute_violationsagainst the analytical formula.Reference: https://github.com/SteinmetzLab/slidingRefractory (
metrics.computeViol).Known non-equivalences (out of scope)
The metric definition now matches the reference, but results are not bit-identical because SI (by existing design) uses a coarser ACG bin size (
bin_size_ms=0.25vs sample-resolution) and a different correlogram engine (_compute_correlograms_*vs the referencehistdiff-equivalent). Full numerical parity would be a separate change.