Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
mvnpdf returns Inf

Subject: mvnpdf returns Inf

From: Duncan

Date: 22 Oct, 2011 19:21:13

Message: 1 of 2

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

Subject: mvnpdf returns Inf

From: Roger Stafford

Date: 22 Oct, 2011 20:11:28

Message: 2 of 2

"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.

Roger Stafford

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us