Skip to content
Prev 19878 / 63421 Next

pbinom( ) function (PR#8700)

On 3/22/2006 3:52 AM, maechler at stat.math.ethz.ch wrote:
Martin, your description makes it sound as though dbinom(0.3, size, 
prob) would give the same answer as dbinom(0, size, prob), whereas it 
actually gives 0 with a warning, as documented in ?dbinom.  The d* 
functions only round near-integers to integers, where it looks as though 
near means within 1E-7.  The p* functions round near integers to 
integers, and truncate others to the integer below.

I suppose the reason for this behaviour is to protect against rounding 
error giving nonsense results; I'm not sure that's a great idea, but if 
we do it, should we really be handling 0 differently?

Duncan Murdoch