[Rd] dhyper() does not allow non-integer values for input parameters m (PR#7393)

From: <Erik.Jorgensen_at_agrsci.dk>
Date: Wed 24 Nov 2004 - 23:05:08 EST

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

# 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=FALSE){

       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ørgensen
Danish Institute of Agricultural Sciences

--please do not edit the information below--

Version:
  platform = i386-pc-mingw32
  arch = i386
  os = mingw32
  system = i386, mingw32
  status =
  major = 2
  minor = 0.1
  year = 2004
  month = 11
  day = 15
  language = 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:base



R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Wed Nov 24 23:30:21 2004

This archive was generated by hypermail 2.1.8 : Fri 18 Mar 2005 - 09:01:43 EST