[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] retrieving the (cumulative) probability at a specific coo
Andrew W. Steiner
Re: [Help-gsl] retrieving the (cumulative) probability at a specific coordinate from the gsl_histogram_pdf struct
Wed, 29 Aug 2012 08:54:51 -0700
Hello Bas and all,
Effectively, it seems that what you need is the CDF corresponding to a
gsl_histogram_pdf struct. Can you use the GSL interpolation routines directly
on the double *range, and double *sum pointers in the gsl_histogram_pdf struct?
In more detail: (i) take the two histograms, (ii) convert both to a pdf using
gsl_histogram_pdf_init(), (iii) create two gsl_interp objects using
gsl_histogram_pdf->range and gsl_histogram_pdf->sum, and then (iv) loop
over the domain, obtaining the CDF for each histogram from the gsl_interp
This is what I was planning on doing for the cdf() function of
but haven't finished that yet.
On Wed, Aug 29, 2012 at 5:49 AM, Rhys Ulerich <address@hidden> wrote:
>> I have two PDF's with different amount of bins and for the KS test I need to
>> get the distance between both PDF's at specific coordinates (let's say that
>> the bins contain a variable of type float). I was hoping to be able to for
>> instance loop over all the bins, retrieve the lowest float value in any bin
>> and somehow calculate the probability at that float value from the other
>> Does anyone know if this is possible with the pdf struct in the GSL?
> A quick look at
> suggests no. The values in any given bin do not seem to be stored.
> You could, however, sort the original data and use a binary search to
> find the minimum and maximum value in any given bin using the bin
> boundaries from gsl_histogram's range member.
> Best of luck,