[Rd] lambda==0 in dpois() (PR#459)
Peter Dalgaard BSA
25 Feb 2000 20:46:40 +0100
> 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.
> 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
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
~~~~~~~~~~ - (firstname.lastname@example.org) 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: email@example.com