Bug 14291 - rbeta inconsistency, sometimes produces NaN
rbeta inconsistency, sometimes produces NaN
Status: RESOLVED FIXED
Product: R
Classification: Unclassified
Component: Accuracy
R 2.11.0
ix86 (32-bit) Linux
: P5 normal
Assigned To: Martin Maechler
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-05-10 12:21 UTC by David Firth
Modified: 2010-05-10 20:37 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Firth 2010-05-10 12:21:00 UTC
The rbeta() function sometimes produces NaN from valid 
argument values.  Example:

> set.seed(1)
> temp <- rbeta(10000, 100, 0.001)
Warning message:
In rbeta(10000, 100, 0.001) : NAs produced

This seems not to happen when shape1 <= shape2:
> set.seed(1)
> temp <- rbeta(10000, 0.001, 100)  ## no NaN in the result here

R Version:
 platform = x86_64-unknown-linux-gnu
 arch = x86_64
 os = linux-gnu
 system = x86_64, linux-gnu
 status = 
 major = 2
 minor = 11.0
 year = 2010
 month = 04
 day = 22
 svn rev = 51801
 language = R
 version.string = R version 2.11.0 (2010-04-22)

Locale:
LC_CTYPE=en_GB.UTF-8;LC_NUMERIC=C;LC_TIME=en_GB.UTF-8;LC_COLLATE=en_GB.UTF-8;LC_MONETARY=C;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=en_GB.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_GB.UTF-8;LC_IDENTIFICATION=C

Search Path:
 .GlobalEnv, package:stats, package:graphics, 
package:grDevices, package:utils, package:datasets, 
package:methods, Autoloads, package:base

-- 
Professor David Firth
http://go.warwick.ac.uk/dfirth
Comment 1 Martin Maechler 2010-05-10 20:37:26 UTC
Inf/Inf gave NaN -- fixed for R-patched (to be R 2.11.1) and R-devel.
as svn rev 51967, 51968