comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Histogram & Cumulative Distribution Functions
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Histogram & Cumulative Distribution Functions [message #40743 is a reply to message #40736] Fri, 27 August 2004 16:08 Go to previous messageGo to previous message
Justin[3] is currently offline  Justin[3]
Messages: 8
Registered: November 2003
Junior Member
Ooops. Late on a Friday. I was meaning cdf in several places I wrote pdf.
Still would have worked mind you. Soz.

So if h is the output of HISTO then:
cumul = TOTAL(h, /CUMULATIVE)
tot = TOTAL(FLOAT(h))
cdf = cumul/tot

To find the 95th percentile use VALUE_LOCATE on the cdf to get the
index of the array element closest to 0.95

index = VALUE_LOCATE(cdf, 0.95)

If 'l' contains the histo locations then your 95th percentile is at:
l[index]

Justin <kf1zr0y02@sneakemail.com> wrote in
news:Xns9552C1E35BA22kf1zr0y02sneakemail@18.181.0.25:

> To get the CDF from a (discrete) PDF use the TOTAL function with the
> CUMULATIVE keyword:
>
> So if h is the output of HISTO then:
> cumul = TOTAL(h, /CUMULATIVE)
> tot = TOTAL(FLOAT(h))
> pdf = cumul/tot
>
> To find the 95th percentile use VALUE_LOCATE on the pdf to get the
> index of the array element closest to 0.95
>
> index = VALUE_LOCATE(pdf, 0.95)
>
> If 'l' contains the histo locations then your 95th percentile is at:
> l[index]
>
> Make sure you have enough bins in the histogram otherwise the
> percentile value can be coarse. You could even create a new histogram
> (just for the cdf calculation) with nbins >= number of data points to
> give an accuarate percentile value.
>
> Hope this helps,
>
> Justin
>
>
>
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Gold Medal Bug in IDL arithmetic?
Next Topic: Re: Gold Medal Bug in IDL arithmetic?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:29:10 PDT 2025

Total time taken to generate the page: 0.00448 seconds