help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: computing binomial distribution tails


From: Ted Harding
Subject: RE: computing binomial distribution tails
Date: Fri, 01 Jul 2005 02:03:23 +0100 (BST)

On 30-Jun-05 Johan Kullstam wrote:
> 
> I wish to compute the tail of a binomial distribution but I keep
> running into numerical difficulties.
> 
> For example, given probability p (small) what is the chance of no
> success for m bernouli trials?
> 
> Q = 1-(1-p)^m
> 
> has trouble when p is near eps in magnitude and fails utterly when p <
> eps.

You can hardly be far out, in this case, with

  (1-p)^m = 1 - m*p

unless m is also large, in which case you might be better with

  (1-p)^m = (1 - (m*p)/m)^m = exp(-m*p)

(which is in effect the Poisson approximation to the Binomial).

Incidentally, your Q = 1 - (1-p)^m is the chance of at least
one success. The chance of no successes is (1-p)^m, i.e. that
all m trials fail.

Hoping this helps,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861
Date: 01-Jul-05                                       Time: 02:03:09
------------------------------ XFMail ------------------------------



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]