imp icon indicating copy to clipboard operation
imp copied to clipboard

Cross correlation evaluates to > 1.0

Open saltzberg opened this issue 4 years ago • 3 comments

Test and files added in 2e3590ae7e showing CoarseCC.cross_correlation_coefficient() evaluating to > 1.0.

I see this when adding two cropped maps together and comparing them to the original map.

Failing test is in medium_test_correlation.py

saltzberg avatar Dec 15 '20 20:12 saltzberg

@ichem001 do you have any insight into what's happening here?

benmwebb avatar Dec 22 '20 22:12 benmwebb

I have seen it happened before; it is one of the reason I do not rely on CoarseCC anymore and developed the new scoring function. When I saw the behavior, it was caused by numerical instability during normalization. When the ccc is normalized, this is where instability occurs (probably because of mean and rms). see:

https://github.com/salilab/imp/blob/c1b65da7176e2419f6a6995988a762d3424386d0/modules/em/src/CoarseCC.cpp#L116-L117

ichem001 avatar Dec 22 '20 23:12 ichem001

Seeing a behavior that may be related: CoarseCC.cross_correlation_coefficient for near optimal localization is most always negative. (ccc < 0.).

ichem001 avatar Feb 12 '21 22:02 ichem001

This is not numerical instability. It's because the EM code caches the RMS and dmean and does not clear this cache when adding two maps together, so incorrect values are used in the CCC calculation. Should be easy to fix though.

benmwebb avatar Dec 05 '22 21:12 benmwebb