title: numpy.ma.cov - pairwise correlations for with missing values?
body: <p>Example dataset (rows were randomly extracted from a much larger matrix)</p>
  
  <pre><code>import numpy as np
  
  test = [[np.nan, np.nan, 0.217, 0.562],
          [np.nan, np.nan, 0.217, 0.562],
          [0.269, 0.0, 0.217, 0.562],
          [np.nan, np.nan, 0.217, -0.953],
          [np.nan, np.nan, 0.217, -0.788],
          [0.75, 0.0, 0.217, 0.326],
          [0.207, 0.0, 0.217, 0.814],
          [np.nan, np.nan, 0.217, 0.562],
          [np.nan, np.nan, 0.217, -0.022],
          [np.nan, np.nan, 0.217, 0.562],
          [np.nan, np.nan, 0.217, -0.953],
          [np.nan, np.nan, 0.217, -0.953],
          [0.078, 0.0, 0.217, -0.953],
          [np.nan, np.nan, 0.217, -0.953],
          [0.078, 0.0, 0.217, 0.562]]
  
  maskedarr = np.ma.array(test)
  
  np.ma.cov(maskedarr,rowvar=False,allow_masked=True)
  
  [[-- -- -- --]
   [-- -- -- --]
   [-- -- 0.0 0.0]
   [-- -- 0.0 0.554]]
  </code></pre>
  
  <p>However, if I use R,</p>
  
  <pre><code>import rpy2.robjects as robjects
  
  robjects.globalenv['maskedarr'] = robjects.FloatVector(maskedarr.T.flatten())
  robjects.r('''
  dim(maskedarr) &lt;- c(%d,%d)
  maskedarr[] &lt;- replace(maskedarr,!is.finite(maskedarr),NA)
  ''' % maskedarr.shape)
  robjects.r('''
  print(cov(maskedarr,use="pairwise"))
  ''')
  
            [,1] [,2] [,3]      [,4]
  [1,] 0.0769733    0    0 0.0428294
  [2,] 0.0000000    0    0 0.0000000
  [3,] 0.0000000    0    0 0.0000000
  [4,] 0.0428294    0    0 0.5536484
  </code></pre>
  
  <p>I get a very different matrix. If pairwise correlations are taken with <code>nan</code>'s removed only for the pair, then I would expect something like R's answer - <code>numpy.ma.cov</code> says that <code>allow_masked=True</code> will allow these pairwise correlations to be calculated, but does not appear to be so. Am I missing something?</p>