Template Function mrpt::random::randomNormalMultiDimensionalMany(const MATRIX&, size_t, std::vector<std::vector<T>>&, std::vector<T> *)

Function Documentation

template<typename T, typename MATRIX>
void mrpt::random::randomNormalMultiDimensionalMany(const MATRIX &cov, size_t desiredSamples, std::vector<std::vector<T>> &ret, std::vector<T> *samplesLikelihoods = nullptr)

Generate a given number of multidimensional random samples according to a given covariance matrix.

Parameters:
  • cov – The covariance matrix where to draw the samples from.

  • desiredSamples – The number of samples to generate.

  • samplesLikelihoods – If desired, set to a valid pointer to a vector, where it will be stored the likelihoods of having obtained each sample: the product of the gaussian-pdf for each independent variable.

  • ret – The output list of samples

Throws:

std::exception – On invalid covariance matrix