mvnpdf returns Inf

Hello,
I've written an implementation of the EM algorithm for estimation of Gaussian mixture model parameters, and have been mostly successful so far, but now I've run into an issue I can't fathom. The algorithm can run, and often complete on the same test cases, but occasionally it produces an error that I think has to do with the mvnpdf function in the statistics toolbox. When I get the error it turns out that one (and only one) of the elements in the returned vector of probabilities is Inf and all other elements are zero. Does anyone have an idea what might be going on here?
Thanks,
Duncan

"Duncan" wrote in message <j7v539$7a$1@newscl01ah.mathworks.com>...
> Hello,
> I've written an implementation of the EM algorithm for estimation of Gaussian mixture model parameters, and have been mostly successful so far, but now I've run into an issue I can't fathom. The algorithm can run, and often complete on the same test cases, but occasionally it produces an error that I think has to do with the mvnpdf function in the statistics toolbox. When I get the error it turns out that one (and only one) of the elements in the returned vector of probabilities is Inf and all other elements are zero. Does anyone have an idea what might be going on here?
> Thanks,
> Duncan
- - - - - - - - - -
Is it possible you are encountering cases where the covariance matrix is singular? As you are undoubtedly aware, probability density values (as opposed to probability values) can easily assume values greater than one with sufficiently small variance values. In the limit these density values could become infinite at a single point or in a subspace and zero elsewhere.

Mathworks' "Distribution Reference" in their Statistics Toolbox document states: "While it is possible to define the multivariate normal for singular (sigma), the density cannot be written as above. Only random vector generation is supported for the singular case." That would appear to imply that you could expect eccentric behavior from 'mvnpdf' if you present it with a singular covariance matrix.