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

Home » Public Forums » archive » Re: Calculating cumulative probability using cgHistoPlot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Calculating cumulative probability using cgHistoPlot [message #78260] Tue, 08 November 2011 11:05
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Xin Tao writes:

> I'm using cghistoplot, and I'm confused by the cumulative probability
> calculated by cghistoplot. I'm wondering whether any one can give me
> some help here.
>
> Suppose we have histdata like this: [2, 0 , 0, 3, 5, 4], then if
> we use the way of cghistoplot to calculate the cumulative probability
> like this:
>
> cumTotal = Total(histData, /CUMULATIVE) ;; gives us
> [2.00000, 2.00000, 2.00000, 5.00000, 10.0000,
> 14.0000]
> probability = Scale_Vector(cumTotal, 0, 1) ;; gives us
> probability = [0.00000 0.00000 0.00000 0.250000
> 0.666667 1.00000]
>
> This is kind of counter-intuitive to me, because the first value of
> histdata is clearly 2, but the probability is 0 until the 4th value.
> However, I'm not experienced in data anlaysis, and I might have
> misunderstood something about "cumulative probability" here.
>
> It seems to be more natural to me to define the cumulative probability
> in the following way:
>
> probability = total(double(hist)/total(double(hist)), /cumula)
>
> Am I right?

Probably. I was cribbing some notes from an R class that
I didn't do all that well in. :-(

I'll look into it. :-)

Cheers,

David



--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Mac Lion Update Produces BadMatch Error
Next Topic: Non Negative Least Squares - NNLS

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

Current Time: Wed Oct 08 19:34:28 PDT 2025

Total time taken to generate the page: 0.00579 seconds