[Rd] lambda==0 in dpois() (PR#459)

Peter Dalgaard BSA p.dalgaard@biostat.ku.dk
25 Feb 2000 20:46:40 +0100


bolker@zoo.ufl.edu writes:

>   The nice new log=TRUE option in dpois appears to mess up the
> case where lambda=0 (I was trying to calculate the likelihood
> of a saturated model).  Because the behavior is now always to
> calculate the probability in terms of exp(log(prob)), there's
> a test for lambda<=0 which really needs to be only lambda<0.
> 
>   dpois(0:5,0)
> 
> ought to give
> 
>  1 0 0 0 0 
> 
> but gives NaNs instead.
> 
>   Here's a patch to src/nmath/dpois.c that appears to work (although it could ? be more
> elegant).

Thanks. We may just be able to squeeze that one in before 1.0.0. But
shouldn't it return -Inf  (ML_NEGINF) for the log case rather than NaN?

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._