[ncl-talk] Query about probability density functions

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Wed Sep 11 08:58:02 MDT 2024


Giorgio, the fortran routine is at *ni/src/lib/nfpfort/xy1pdf77.f* in the
NCL v6.6.2 source code.


On Wed, Sep 11, 2024 at 8:01 AM Giorgio Graffino via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:

> Hi Dennis,
>
> Thank you for pointing out that detail.
>
> I've found the code of the pdfx function in here (
> https://github.com/NCAR/ncl/blob/develop/ni/src/examples/gsun/contributed.ncl)
> and the frequency is computed as pdf = 100d0*pdf/nMax. I tried to normalize
> the pdf by multiplying the frequency pdf by the number of data and divide
> by 100, but the results is very different depending on the number of data
> to compute the pdf. Also, the results are different from similar
> computations using Python, especially with large number of data. Without
> knowing what the Fortran routine does (and I can't find it), I don't know
> how to normalize NCL to match Python.
>
> Any suggestions?
>
> Cheers,
>
> Giorgio
>
>
>
> ------ Messaggio Originale ------
> Da: shea at ucar.edu
> A: g.graffino at tim.it Cc: ncl-talk at ucar.edu
> Inviato: lunedì, settembre 9º 2024, 08:15 PM
> Oggetto: Re: [ncl-talk] Query about probability density functions
> From the *pdfx*
> <https://www.ncl.ucar.edu/Document/Functions/Contributed/pdfx.shtml>
> documentation:  "The PDF units are percent [%]."
>
> Divide by 100.
>
>
> On Mon, Sep 9, 2024 at 10:26 AM Giorgio Graffino via ncl-talk <
> ncl-talk at mailman.ucar.edu> wrote:
>
>
>> Hello NCL experts,
>>
>> I'm using pdfx to compute probability density functions (
>> https://www.ncl.ucar.edu/Document/Functions/Contributed/pdfx.shtml). I
>> noticed that the cumulative density functions sum up to 100 in NCL, instead
>> of 1 as per definition. Why is that? How can I normalize them back to 1?
>>
>> Thanks for your help.
>>
>> Cheers,
>>
>> Giorgio
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20240911/10d2c931/attachment-0001.htm>


More information about the ncl-talk mailing list