Skip to content

pbinom with size argument 0 (PR#8560)

1 message · Uffe Høgsbro Thygesen

#
Hello all

A pragmatic argument for allowing size==0 is the situation where the size is in itself a random variable (that's how I stumbled over the inconsistency, by the way).

For example, in textbooks on probability it is stated that:

  If X is Poisson(lambda), and the conditional 
  distribution of Y given X is Binomial(X,p), then 
  Y is Poisson(lambda*p).

(cf eg Pitman's "Probability", p. 400)

Clearly this statement requires Binomial(0,p) to be a well-defined distribution.

Such statements would be quite convoluted if we did not define Binomial(0,p) as a legal (but degenerate) distribution. The same applies to codes where the size parameter may attain the value 0.

Just my 2 cents.

Cheers,

Uffe


-----Oprindelig meddelelse-----
Fra: pd at pubhealth.ku.dk p? vegne af Peter Dalgaard
Sendt: s? 05-02-2006 01:33
Til: P Ehlers
Cc: ted.harding at nessie.mcc.ac.uk; Peter Dalgaard; R-bugs at biostat.ku.dk; r-devel at stat.math.ethz.ch; Uffe H?gsbro Thygesen
Emne: Re: [Rd] pbinom with size argument 0 (PR#8560)
 
P Ehlers <ehlers at math.ucalgary.ca> writes:
What's the problem ??

An n=0 binomial is the sum of an empty set of Bernoulli RV's, and the
sum over an empty set is identically 0.
Consistency is what you gain. E.g. 

 binom(.,n=n1+n2,p) == binom(.,n=n1,p) * binom(.,n=n2,p)

where * denotes convolution. This will also hold for n1=0 or n2=0 if
the binomial in that case is defined as a one-point distribution at
zero. Same thing as any(logical(0)) etc., really.