Skip to content
Prev 19372 / 63424 Next

pbinom with size argument 0 (PR#8560)

On Sun, 5 Feb 2006, Peter Dalgaard wrote:

            
Consistency is a Good Thing, and I had already altered the codebase to 
consistently allow size=0 as a discrete distribution concentrated at 0.

There were other inconsistencies, e.g. whether the geometric/negative 
binomial functions allow prob=0 or prob=1.  I have no problem with prob=1 
(it is a discrete distribution concentrated on one point) and this was 
addressed for rnbinom before (PR#1218) but subsequently broken (which is 
why we like regression tests ...).  However prob=0 does not correspond to 
a proper distribution unless Inf is allowed as a value, and it was not so 
documented (nor implemented).  Indeed we had
[1] 0
[1] 0
[1] 0

and in fact dgeom gave zero for every allowed value.  So I cannot accept 
that as being right (and we even have a d-p-q-r test with prob=0).