This problem is solved. Thank you @dpwe
I first make the GMM by gmdistribution. Then I want to have a function that can return the probability of my Observation. That is:
GMMObject = gmdistribution(Vec_Mean, Matrix_Covariance, Vec_Weight);
Probability = posterior(GMMObject, Vec_Observation) * Vec_Weight;
The value of Probability
should equal to p(x)
But I find that log(Probability)
is not equal to nlogl
where:
[Dummy, nlogl] = posterior(GMMObject, Vec_Observation)
So I am wondering where is my mistake.