goran.brostrom at gmail.com
2006-Jul-14 17:08 UTC
[Rd] dweibull retuns NaN instead of Inf (PR#9080)
Full_Name: G?ran Brostr?m Version: 2.3.1 OS: Linux, ubuntu Submission from: (NULL) (85.11.40.53)> dweibull(0, 0.5, 1)[1] NaN Warning message: NaNs produced in: dweibull(x, shape, scale, log) should give Inf (and no Warning). Compare with> dgamma(0, 0.5, 1)[1] Inf This happens when 'shape' < 1.
ripley at stats.ox.ac.uk
2006-Jul-15 21:00 UTC
[Rd] dweibull retuns NaN instead of Inf (PR#9080)
This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --27464147-852712393-1152995865=:29235 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-1 Content-Transfer-Encoding: 8BIT Content-ID: <Pine.LNX.4.64.0607152148581.29235 at gannet.stats.ox.ac.uk> This is debatable: according to ?dweibull and ?dgamma both pdfs are defined with support (0, Inf), so in both cases the correct answer would appear to be 0. This is in contrast to ?dexp which has the density defined on x >= 0. It seems most references have the support as [0, Inf), in which case the problem is the evaluation of x log x or equivalent. It seems we should change both the documentation and the result. On Fri, 14 Jul 2006, goran.brostrom at gmail.com wrote:> Full_Name: G?ran Brostr?m > Version: 2.3.1 > OS: Linux, ubuntu > Submission from: (NULL) (85.11.40.53) > > > > dweibull(0, 0.5, 1) > [1] NaN > Warning message: > NaNs produced in: dweibull(x, shape, scale, log) > > should give Inf (and no Warning). Compare with > > > dgamma(0, 0.5, 1) > [1] Inf > > This happens when 'shape' < 1. > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 --27464147-852712393-1152995865=:29235--