Template Function mrpt::math::meanAndCovMat

Function Documentation

template<class MAT_IN, class VECTOR, class MAT_OUT>
void mrpt::math::meanAndCovMat(const MAT_IN &v, VECTOR &out_mean, MAT_OUT &out_cov)

Computes the mean vector and covariance from a list of samples in an NxM matrix, where each row is a sample, so the covariance is MxM.

See also

mrpt::math::meanAndCovVec, math::mean,math::stddev, math::cov

Parameters:
  • v – The set of data as a NxM matrix, of types: CMatrixDynamic or CMatrixFixed

  • out_mean – The output M-vector for the estimated mean.

  • out_cov – The output MxM matrix for the estimated covariance matrix, this can also be either a fixed-size of dynamic size matrix.