(PR#7393) Re: [Rd] dhyper() does not allow non-integer values for
tlumley at u.washington.edu
tlumley at u.washington.edu
Wed Nov 24 16:11:07 CET 2004
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
---1936847065-1111238301-1101309010=:193006
Content-Type: TEXT/PLAIN; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
On Wed, 24 Nov 2004 Erik.Jorgensen at agrsci.dk wrote:
>
> dhyper() does not allow non-integer values for input parameters m and n.
>
> this is in contrast to the other functions in the _hyper() "family",
I would argue that the bug was in the other functions. If not, there is a=
=20
bug in the documentation, which gives no way to tell what the result=20
should mean for non-integer m, n, k.
=09-thomas
> # OK
> dhyper(1,10,90,10)
>
> # NaN
> dhyper(1,10.5,90,10)
>
> # OK
> phyper(1,10,90,10)
> phyper(1,10.5,90,10)
>
> # OK
> qhyper(0.71,10,90,10)
> qhyper(0.71,10.5,90,10)
>
> # OK
> rhyper(1,10,90,10)
> rhyper(1,10.5,90,10)
>
>
>
> # this "naive" version of dhyper() works
>
> dhyperx<-function(x,m,n,k,log=3DFALSE){
> lp<-lchoose(m, x) + lchoose(n, k-x) - lchoose( m+n, k)
> if (log) {lp} else {exp(lp)}
> }
>
> # OK
> dhyperx(1,10,90,10)
> dhyperx(1,10.5,90,10)
>
>
>
> Erik J=F8rgensen
> Danish Institute of Agricultural Sciences
>
>
>
> --please do not edit the information below--
>
> Version:
> platform =3D i386-pc-mingw32
> arch =3D i386
> os =3D mingw32
> system =3D i386, mingw32
> status =3D
> major =3D 2
> minor =3D 0.1
> year =3D 2004
> month =3D 11
> day =3D 15
> language =3D R
>
> Windows XP Professional (build 2600) Service Pack 1.0
>
> Search Path:
> .GlobalEnv, package:methods, package:stats, package:graphics,
> package:grDevices, package:utils, package:datasets, Autoloads, package:ba=
se
>
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>
Thomas Lumley=09=09=09Assoc. Professor, Biostatistics
tlumley at u.washington.edu=09University of Washington, Seattle
---1936847065-1111238301-1101309010=:193006--
More information about the R-devel
mailing list