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

goodrich at fas.harvard.edu goodrich at fas.harvard.edu
Tue Dec 19 22:45:33 CET 2006


-----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 .

- --please do not edit the information below--

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-----



More information about the R-devel mailing list