3 #include "../exception/invalidargumentexception.h"
4 #include "../point/pointgmm.h"
5 #include "../point/point.h"
10 : weights(w), gaussians(g)
12 if (w.size() != g.size())
26 size_t k = this->
weights.size();
28 for (
size_t i=0; i<k; ++i)
41 size_t k = this->
weights.size();
46 for (
size_t i=1; i<k; ++i)
61 size_t k = this->
weights.size();
65 ret = this->
gaussians[0].squaredMahalanobis(x);
66 for (
size_t i=1; i<k; ++i)
68 double c = this->
gaussians[i].squaredMahalanobis(x);
virtual double density(Point const &x) const
Evaluates the density of the GMM distribution at the given point x.
virtual double nll(Point const &x) const
Computes the negative log-likelihood of the density at the given point x.
PointGMM(std::vector< double > const &, std::vector< PointGauss > const &)
std::vector< double > weights
virtual double minNLL(Point const &x) const
Weighted point of arbitrary dimension.
Indicates invalid values of arguments.
std::vector< PointGauss > gaussians
virtual double minSquaredMahalanobis(Point const &x) const