lib.mpi.var_array

lib.mpi.var_array(a, axis=- 1, fweights=None, aweights=None, ddof=1, mpicomm=None)

Estimate variance, given data and weights. See numpy.var(). TODO: allow several axes.

Parameters
  • a (array) – Array containing numbers whose variance is desired. If a is not an array, a conversion is attempted.

  • axis (int, default=-1) – Axis along which the variance is computed.

  • 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) – 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.

  • mpicomm (MPI communicator) – Current MPI communicator.

Returns

out – The variance of the variables.

Return type

array