lib.mpi.cov_array

lib.mpi.cov_array(m, y=None, ddof=1, rowvar=True, fweights=None, aweights=None, dtype=None, mpicomm=None)

Estimate a covariance matrix, given data and weights. See numpy.cov().

Parameters
  • m (array) – A 1D or 2D array containing multiple variables and observations. Each row of m represents a variable, and each column a single observation of all those variables. Also see rowvar below.

  • y (array, default=None) – An additional set of variables and observations. y has the same form as that of m.

  • rowvar (bool, default=True) – If rowvar is True (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations.

  • fweights (array, int, default=None) – 1D array of integer frequency weights; the number of times each observation vector should be repeated.

  • aweights (array, default=None) – 1D array of observation vector weights. These relative weights are typically large for observations considered “important” and smaller for observations considered less “important”. If ddof=0 the array of weights can be used to assign probabilities to observation vectors.

  • ddof (int, default=1) – Number of degrees of freedom. Note that ddof=1 will return the unbiased estimate, even if both fweights and aweights are specified, and ddof=0 will return the simple average.

  • dtype (data-type, default=None) – Data-type of the result. By default, the return data-type will have at least numpy.float64 precision.

  • mpicomm (MPI communicator) – Current MPI communicator.

Returns

out – The covariance matrix of the variables.

Return type

array