[Rd] Bug in rt() ? (PR#9422)

From: <goodrich_at_fas.harvard.edu>
Date: Tue 19 Dec 2006 - 21:45:33 GMT


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

<<insert bug report here>>
Reproduced on Debian and Windows ...

On 2.4.x if you execute

set.seed(12345)
t.1 <- rt(n = 1000, df = 20)

set.seed(12345)
t.2 <- rt(n = 1000, df = 20, ncp = 0)

all.equal(t.1, t.2) ## Not close to true

This appears to be due to the fact that in 2.4.x rt is now

rt
function (n, df, ncp = 0)
{

    if (missing(ncp))

                .Internal(rt(n, df))

    else rnorm(n, ncp)/sqrt(rchisq(n, df)/df) }
<environment: namespace:stats>

Whereas in 2.3.1 rt() is verified to work as expected when someone (redundantly) types ncp = 0

rt
function (n, df, ncp = 0)
{

    if (ncp == 0)
   .Internal(rt(n, df))
    else rnorm(n, ncp)/(rchisq(n, df)/sqrt(df)) }
<environment: namespace:stats>

The only interface difference is missing(ncp) vs. ncp == 0 .

Version:
 platform = i486-pc-linux-gnu
 arch = i486
 os = linux-gnu
 system = i486, linux-gnu
 status =
 major = 2
 minor = 4.1
 year = 2006
 month = 12
 day = 18
 svn rev = 40228
 language = R
 version.string = R version 2.4.1 (2006-12-18)

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

Search Path:
 .GlobalEnv, package:car, package:rkward, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, package:methods, Autoloads, package:base
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFiF09zQDSXIcN85kRAhK4AKCBmPNkGszTzFdALfiGgW1LfNIOTwCfZ8RM 0gZjer8+rnmOPDFKZXBbFQw=
=ff85
-----END PGP SIGNATURE-----



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Dec 21 04:37:43 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 20 Dec 2006 - 18:31:03 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.