Fix Llobet expected-violations formula in sliding RP metric#4682
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.
|
The original repo fix is here for reference: SteinmetzLab/slidingRefractory#8 |
|
I think @DradeAW wrote the initial implementation based on working with Llobet right Aurélien? If you have a moment to comment on this that would be great. |
|
Hi @oliche, thanks for pushing your changes to si! I thought I'd try to verify the change in the Llobet formula but I'm getting confused when reading the original paper/calculation. Some more specific referencing would help me: where in the paper is the discussion about the expected violations? And doesn't this depend on the modeling assumptions: e.g. whether the contamination is due to a single contaminating neuron or totally random noise? Thanks! |
|
Hi all! |
|
So I looked over some code: You are proposing a change in the function However, if there are questions about the Llobet formula, I would be happy to answer you :) Best to you guys! |
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.