|
From: | Daniel J Sebald |
Subject: | Re: binocdf inaccuracy in Octave |
Date: | Mon, 08 Jul 2013 12:29:48 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16 |
On 07/08/2013 11:38 AM, Rik wrote:
7/8/13 Dr. Klein, I think this is actually a much easier problem to solve that it first appeared. In the the file binocdf.m the formula used to calculate the CDF is cdf(k) = 1 - betainc (p, tmp + 1, n - tmp); According to Wikipedia (http://en.wikipedia.org/wiki/Binomial_distribution) the CDF for the binomial distribution is \textstyle I_{1-p}(n - k, 1 + k) or I(1-p, n-k, 1+k) So it appears that we simply have the arguments wrong to the betainc function.
But it is also true that \textstyle I_{x}(a, b) = I_{1-x}(b, a) http://en.wikipedia.org/wiki/Regularized_incomplete_beta_function#Incomplete_beta_functionIn other words, the two expressions you are comparing are mathematically equivalent. Where is the discrepancy then? Numerical issues?
Dan
[Prev in Thread] | Current Thread | [Next in Thread] |