sortingQuality icon indicating copy to clipboard operation
sortingQuality copied to clipboard

ISIViolations can be imaginary

Open RoddyMGrieves opened this issue 6 months ago • 0 comments

I think the ISIViolations.m function can still output imaginary values.

From Llobet et al. 2022 (pp 11): "The equations for C and C' may not have a real solution if nv is large; this can arise if the activities of reference and contaminant spikes are strongly correlated, thus causing a departure from the assumption of independent firing, and/or as a result of stochastic variations. In such cases - almost invariably removed by a quality threshold - we simply follow the convention of setting C = 1."

I have observed imaginary values for fpRate, even though the comments at the top of the code say that the expression no longer returns imaginary values.

I suggest adding:

if ~isreal(fpRate)
    fpRate = 1;
end

RoddyMGrieves avatar Jul 11 '25 19:07 RoddyMGrieves