|
From: | Rik |
Subject: | Re: binocdf inaccuracy in Octave |
Date: | Mon, 08 Jul 2013 09:38:27 -0700 |
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 or I(1-p, n-k, 1+k) So it appears that we simply have the arguments wrong to the betainc function. I modified binocdf.m to cdf(k) = betainc (1 - p, n - tmp, tmp + 1); and now I get the same answers as Erlang to ~14 significant digits which seems acceptable. Can you verify that this now correct? --Rik |
binocdf.m
Description: Text Data
[Prev in Thread] | Current Thread | [Next in Thread] |