bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gsl] [bug #47646] gsl_ran_beta returns NaN for small arguments


From: Yu Liu
Subject: Re: [Bug-gsl] [bug #47646] gsl_ran_beta returns NaN for small arguments
Date: Thu, 15 Sep 2016 13:59:36 -0700

Patrick,
   I was thinking if it's worthwhile to allow the use of close-form cdf for
some functions. Currently, the test routine calculates the expected
probability in each bin using numerical integration of pdf. In this
particular case, it blows up. Using cdf in stead of integration can avoid
the problem, but I am not sure if this is appropriate. There are other
functions with close-form cdf as well, and I am wondering whether it can be
used to replace integration as well.
  In a modified test routine, I added a flag to indicate whether the input
function ``pdf" is actually a cdf, and if that is the case, the probability
in each bin would be simply cdf[x+dx] - cdf[x]. Please see the relevant
lines here
https://github.com/ohliumliu/gsl-playground/blob/issue2/scratchpad/test_beta_small.c#L461-#L464
One obvious issue is that in this function, the input ``pdf" could mean pdf
or cdf depending on the value of the flag. This may be confusing.
   Without much experience in numerical computation, maybe I am proposing
something crazy.

Best,
yu


On Thu, Sep 15, 2016 at 1:20 PM, Patrick Alken <address@hidden>
wrote:

> Follow-up Comment #4, bug #47646 (project gsl):
>
> I'm also not sure how to properly test for this case, as the PDF
> integration
> test fails for these small arguments.
>
>     _______________________________________________________
>
> Reply to this item at:
>
>   <http://savannah.gnu.org/bugs/?47646>
>
> _______________________________________________
>   Message sent via/by Savannah
>   http://savannah.gnu.org/
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]