Hi,
If I pass a masked array through np.asarray, I get original unmasked array.
Example:
test = np.array([[1, 0], [-1, 3]])
testMasked = ma.masked_less_equal(test, 0)
print testMasked
[[1 --]
[-- 3]]
print testMasked.fill_value
99
print np.asarray(testMasked)
[[ 1 0]
[-1 3]]
Thanks Josef and Nathaniel for your responses.
In the application that I have, I don't use the correlation coefficient
matrix as a whole (so I don't care if it is PSD or not). I simply read the
off-diagonal elements for pair-wise correlation coefficients. I use the
pairwise correlation coefficient
Hi everyone,
I'm using np.ma.corrcoef to compute the correlation coefficients among rows
of a masked matrix, where the masked elements are the missing data. I've
observed that in some cases, the np.ma.corrcoef gives invalid coefficients
that are greater than 1 or less than -1.
Here's an example: