From Kurt.Hornik@ci.tuwien.ac.at  Mon May 12 07:17:50 1997
From: Kurt.Hornik@ci.tuwien.ac.at (Kurt Hornik)
Date: Mon, 12 May 1997 08:17:50 +0200
Subject: R-alpha: Hypergeometric Distribution
In-Reply-To: <199705120035.MAA05932@stat1.stat.auckland.ac.nz>
References: <199705120035.MAA05932@stat1.stat.auckland.ac.nz>
Message-ID: <199705120617.IAA26676@aragorn.ci.tuwien.ac.at>

>>>>> Ross Ihaka writes:

> A cut and paste typo has crept in and is rendering all values returned
> for the hypergeometric distribution incorrect.  The problem is in
> src/main/arithmetic.c in the function "math4".  The lines

>         PROTECT(sy = allocVector(REALSXP, n));
>         a = REAL(sa);
>         b = REAL(sb);
>         c = REAL(sc);
>         d = REAL(sc);	/* <-- change this line */
>         y = REAL(sy);

> should read

>         PROTECT(sy = allocVector(REALSXP, n));
>         a = REAL(sa);
>         b = REAL(sb);
>         c = REAL(sc);
>         d = REAL(sd);	/* corrected */
>         y = REAL(sy);

> This will be part of the official 2nd patch to 0.49, but I'm pointing it
> out anyway.

Thanks for the patch.

It fixes the problem reported by myself on 25 Apr 1997 (makes my Fisher
test work again) and by Ennapadam Venkatraman <VENKAT@biosta.mskcc.org>
on 30 Apr 1997.

Note that the problem with `rhyper(5,200,250,60)' never returning still
seems to exist.

-k
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: Hypergeometric Distribution
Kurt Hornik