SCC computation bug for constant diags
Closed this issue · 2 comments
minjaf commented
If diagonal is filled with constants (i.e. zeros) for both samples, the correlation between two arrays A=[const, const, const, .... , const] and B=[const, const, const, .... , const] will be Nan (i.e. Spearman (A,B) = Nan). This results sum of correlations computed later to be Nan.
scc = np.sum(corr_diag * weight_diag)
To fix this, I suggest changing this line as follows:
Line 273 in 771cf72
scc = np.nansum(corr_diag * weight_diag)
cmdoret commented
Thanks for the suggestion, I have updated the code and tests in aforementioned PR, will merge in master and make a release as soon as all checks pass
cmdoret commented
I released version 0.1.0 on PyPI, which includes this fix. Let me know if you encounter issues. Thanks for the suggestion :)