You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fcma: compute_correlation returns zeros for NaNs #400
I just noticed that brainiak.fcma.util.compute_correlation returns float zeros when computing the correlation between vectors containing NaNs, which is inconsistent with other correlation computations in Python like np.corrcoef and scipy.stats.pearsonr (which return np.nan). Is this the desired output? Or is it necessary for the high-speed BLAS implementation? Might not be worth bothering with—was just curious.
We designed in this way to prevent the entire computation from crash when encountering the NaN vectors. We can point this out in the docstring if you think this may lead to some potential issue.
Okay, makes sense. When invoking compute_correlation in the isfc function, I may reassign these zeros to NaNs at the output stage to make the output consistent with isc. I can add a sentence to the compute_correlation docstring mentioning this.
Activity
yidawang commentedon Jan 10, 2019
We designed in this way to prevent the entire computation from crash when encountering the NaN vectors. We can point this out in the docstring if you think this may lead to some potential issue.
snastase commentedon Jan 10, 2019
Okay, makes sense. When invoking
compute_correlationin theisfcfunction, I may reassign these zeros to NaNs at the output stage to make the output consistent withisc. I can add a sentence to thecompute_correlationdocstring mentioning this.yidawang commentedon Jan 10, 2019
Or can you submit a PR to add an argument to this function, indicating if we will convert NaN to 0? Thanks!