Le 04/12/2018 à 19:12, Martin Maechler a écrit :
Serguei Sokol
     on Tue, 4 Dec 2018 11:46:32 +0100 writes:
     > Le 04/12/2018 à 11:27, Iñaki Ucar a écrit :
     >> On Tue, 4 Dec 2018 at 11:12, <qwey...@mail.ustc.edu.cn> wrote:
     >>> function ppois is a function calculate the CDF of Poisson 
distribution, it should generate a non-decreasing result, but what I got is:
     >>>
     >>>> any(diff(ppois(0:19,lambda=0.9))<0)
     >>> [1] TRUE
...
     > any(diff(exp(ppois(0:19, lambda=0.9, log.p=TRUE))) < 0)
     > #[1] FALSE

     > But may be there is another, more economic way?

Well, log probabilites *are* very economic for many such p*()
functions.
I have not doubt about it. My "economic way" was related to get ppois() *non decreasing*, at least, more economic than exp-log.p trick.

Serguei.

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to