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:
pdf derived from another pdf

Subject: pdf derived from another pdf

From: Dhrue

Date: 26 Jul, 2009 17:39:01

Message: 1 of 2

Let density=@(z) lognpdf(z,4,1.3);
%I want to construct a new pdf from density by only talking the distrubution of all
%observations z>100 and normalize it by the mass of this tail.

new_density=@(z) (density(find(z>100)))./quadgk(density,100,3000)

but this is not working.....ideally quadgk(new_density,100,3000) should equal 1 but that is not hapenning.....any suggestions please.....

Subject: pdf derived from another pdf

From: Tom Lane

Date: 27 Jul, 2009 01:52:10

Message: 2 of 2

> Let density=@(z) lognpdf(z,4,1.3);
> %I want to construct a new pdf from density by only talking the
> distrubution of all
> %observations z>100 and normalize it by the mass of this tail.
>
> new_density=@(z) (density(find(z>100)))./quadgk(density,100,3000)
>
> but this is not working.....ideally quadgk(new_density,100,3000) should
> equal 1 but that is not hapenning.....any suggestions please.....

Think about this. if z<100 then new_density will give an empty value. If Z
is an array containing some values <100 and some >1, then this will return
something not of the same size as z. Try instead:

new_density = @(z) (z>100).*density(z)./quadgk(density,100,3000)

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