From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2706 invoked by alias); 23 Oct 2007 05:50:54 -0000 Received: (qmail 4972 invoked by uid 22791); 22 Oct 2007 20:13:06 -0000 X-Spam-Check-By: sourceware.org Message-ID: <471D0516.5080103@ncsu.edu> Date: Tue, 23 Oct 2007 05:50:00 -0000 From: Benjamin Redelings User-Agent: Mozilla-Thunderbird 2.0.0.6 (X11/20071008) MIME-Version: 1.0 To: gsl-discuss@sourceware.org Subject: Problems with gsl_cdf_gamma_Pinv(0.01,a,b) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2007-q4/txt/msg00003.txt.bz2 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