pdf derived from another pdf

Discussion in 'MATLAB' started by Dhrue, Jul 26, 2009.

  1. Dhrue

    Dhrue Guest

    Let [email protected](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.

    [email protected](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.....
    Dhrue, Jul 26, 2009
    1. Advertisements

  2. Dhrue

    Tom Lane Guest

    Let [email protected](z) lognpdf(z,4,1.3);
    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
    Tom Lane, Jul 27, 2009
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.