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:
multiple peaks in the plot of probability density function

Subject: multiple peaks in the plot of probability density function

From: kumar vishwajeet

Date: 18 Sep, 2010 04:25:05

Message: 1 of 6

Hi,
I am trying to approximate a non-Gaussian pdf for the states of a sysytem of order 3 with the sum of 2 gaussian pdfs. When I plot the new approximate marginal pdf against the first two states, I see multiple peaks in the plot though the plot, overall, looks like a normal curve. But there are some zig-zags that make the curve rough rather than smooth. What could be the possible reason.

Subject: multiple peaks in the plot of probability density function

From: ImageAnalyst

Date: 18 Sep, 2010 12:30:51

Message: 2 of 6

Where's your sample code, or plot of it that you've uploaded
somewhere? Possible reason may be quantization error? Tough to say
without a picture.

Subject: multiple peaks in the plot of probability density function

From: kumar vishwajeet

Date: 19 Sep, 2010 05:39:06

Message: 3 of 6

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <d7a3e75d-aa47-4809-9489-b4f0f0ffc7b1@u13g2000vbo.googlegroups.com>...
> Where's your sample code, or plot of it that you've uploaded
> somewhere? Possible reason may be quantization error? Tough to say
> without a picture.

Here are the sample images from the code:-
http://www.mediafire.com/file/h1fkldf7lpo10k6/sim.pdf

Subject: multiple peaks in the plot of probability density function

From: kumar vishwajeet

Date: 19 Sep, 2010 05:43:05

Message: 4 of 6

"kumar vishwajeet" <kwzeet@gmail.com> wrote in message <i747lq$s5g$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <d7a3e75d-aa47-4809-9489-b4f0f0ffc7b1@u13g2000vbo.googlegroups.com>...
> > Where's your sample code, or plot of it that you've uploaded
> > somewhere? Possible reason may be quantization error? Tough to say
> > without a picture.
>
Here are the sample images from the code:-
http://www.mediafire.com/file/h1fkldf7lpo10k6/sim.pdf

I forgot to mention that I am expecting only two peaks corresponding to two Gaussian components.

Subject: multiple peaks in the plot of probability density function

From: ImageAnalyst

Date: 19 Sep, 2010 14:43:15

Message: 5 of 6

I have no idea why your Gaussian peaks, which should be smooth and
monotonic going down from the central peak, appear to have a sawtooth
shape superimposed on them. Do the numbers also bear that out when
yuou look at them in the variable editor - just to be sure it's not
some kind of plotting artifact?

You'd have to post your code for someone to figure this out.

Subject: multiple peaks in the plot of probability density function

From: Tom Lane

Date: 20 Sep, 2010 15:30:56

Message: 6 of 6

> Here are the sample images from the code:-
> http://www.mediafire.com/file/h1fkldf7lpo10k6/sim.pdf
>
> I forgot to mention that I am expecting only two peaks corresponding to
> two Gaussian components.

It's hard to be sure, but I suspect the effect you're seeing is an artifact
of the coarse gridding. Notice that the density appears to span much of the
axis in one direction, but not much in the other direction. You can see a
similar effect if you compare these:

 ezsurf(@(x,y) mvnpdf([x y],[0 0],[1 -.9;-.9 1]),[-2 2],[-2 2])
 ezsurf(@(x,y) mvnpdf([x y],[0 0],[1 -.9;-.9 1]),[-2 2],[-5 5])
 ezsurf(@(x,y) mvnpdf([x y],[0 0],[1 -.9;-.9 1]),[-2 2],[-10 10])

Try making one axis (X I think) go from, say, -6 to 4. See if that looks
better.

-- Tom

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