Computational shortcuts/approximations for beta-binomial and beta-negative binomial CDFs There are several simplifications that can be done so that computing cumulative distribution functions of beta-binomial and beta-negative binomial distributions, but still computing CDF as $F(x) = \sum_{k=0}^x f(k)$ is computationally intensive. Are there any computational shortcuts, or approximations that can be used so to simplify the calculations?
 A: I have no idea what you know on this subject which is not particularly simple.
Obviously, you can express f(k+1) in terms of f(k) to save the effort of calculating the pdf function x+1 times. To minimise error propagation, you would be best finding the largest value of f(k) and working with summations away from that value until the terms are sufficiently small. If x is large, say > 100million then this approach may still not be very good. You also cannot use this approach and subtract from 1 to find the summation from x+1 upwards because the summation to x can be arbitrarily close to 1.
On the other hand if you only want to calculate the cdf and only for small values of x, then this type of approach will be adequate.
Ian Smith
P.S. There are obvious connections between cdf_hypergeometric, cdf_betabinomial & cdf_betanegativebinomial when the parameter values are all integral but they can be extended when the parameters are non-integral.
cdf_BNB(i,r,a,b) = pmf_BNB(i,r,b,a) + cdf_BNB(i-1,r,a,b)
cdf_BNB(i,r,a,b) = PBB(i,r,b,a) + cdf_BNB(i-1,r+1,a,b)
and since cdf_BNB(i,r,a,b) = cdf_BNB(i,b,a,r)
cdf_BNB(i,r,a,b) = PBB (i,b,r,a) + cdf_BNB(i-1,r,a,b+1)
cdf_BNB(i,r,a,b) = HT(i,r,b,a-1) + cdf_BNB(i-1,r+1,a-1,b+1)
where PBB is essentially the pmf of the BetaBinomial but where non-integral values are allowed for the sample size i.e. PBB(i,r,a,b) = pmf_BB(i,i+r,a,b) when r is integral
and HT is essentially the pmf of the hypergeometric distribution but where non-integral values are allowed for the sample size, total number of type1s and total number of items to be selected from.
HT(i,r,a,b) = pmf_hypergeometric(i,i+r,i+a,i+r+a+b)
The equivalent survival function relationships are
sf_BNB(i,r,a,b) = pmf_BNB(i+1,r,a,b) + sf_BNB(i+1,r,a,b)
sf_BNB(i,r,a,b) = PBB(i+1,r-1,a,b) + sf_BNB(i+1,r-1,a,b)
sf_BNB(i,r,a,b) = PBB(i+1,b-1,a,r) + sf_BNB(i+1,r,a,b-1)
and
sf_BNB(i,r,a,b) = HT(i+1,r-1,b-1,a) + sf_BNB(i+1,r-1,a+1,b-1)
For integral r, b
sf_BNB(i,r,a,b) =cdf_BNB(r-1,i+1,b,a)
sf_BNB(i,r,a,b) =cdf_BNB(b-1,i+1,r,a)
