public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Benjamin Redelings <benjamin_redelings@ncsu.edu>
To: gsl-discuss@sourceware.org
Subject: Problems with gsl_cdf_gamma_Pinv(0.01,a,b)
Date: Tue, 23 Oct 2007 05:50:00 -0000	[thread overview]
Message-ID: <471D0516.5080103@ncsu.edu> (raw)

Hi,

I have been using GSL 1.10 on a 64-bit linux system (Debian/AMD64), and 
I've been trying to figure out how to handle problems like the following:

    // works fine
    gsl_cdf_gamma_Pinv(0.01, 11.888, 1.0);

    // fails to converge
    gsl_cdf_gamma_Pinv(0.01,11.887411491530846,1.0);

Since version 1.10, this failure is a hard failure - e.g. it returns 
GSL_NAN or it terminates. 

My explorations indicate that the range on 'a' in this function is not 
very large, in the grand scheme of things.  It seems like it can be 
expected to work if 'a' is in [0.25, 10] and also for some values outside.

Q1: I'm very much interested in advice on how to handle this kind of 
situation.  Should I expect this to work in GSL, or is there some reason 
why GSL does not want this to work (e.g. speed issues)?  Should I write 
some code myself to revert to a gaussian when a > 10?

Q2: I notice that the R code for this function is more intricate and 
seems to handle values of alpha that are very high (e.g. 500) and very 
low (0.01).  At least, qgamma(0.0001,500,1) and qgamma(0.0001,0.01,1) 
give me answers inside the R program.

The R algorithm seems to use the Chi^2 distribution (which is, I 
suppose, like the Normal distribution, effectively scale-independent).  
Is there any interest in expanding gsl_cdf_gamma_Pinv( ) to handle 
similar ranges to the code in R?

https://svn.r-project.org/R/trunk/src/nmath/qgamma.c

Thanks!

-BenRI

             reply	other threads:[~2007-10-23  5:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-23  5:50 Benjamin Redelings [this message]
2007-10-23 22:11 ` Brian Gough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=471D0516.5080103@ncsu.edu \
    --to=benjamin_redelings@ncsu.edu \
    --cc=gsl-discuss@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).