2
$\begingroup$

I am in need of variance of doubly truncated binomial distribution (equation number 3.69 on page number 137 of third edition of Johnson, Kemp and Kotz Discrete Probability Distributions).

Thanks. Anwer

$\endgroup$

1 Answer 1

3
$\begingroup$

Let $X \sim \text{Binomial}(n,p)$ with pmf $f(x)$:

enter image description here

Let $a$ and $b$ denote the lower and upper points of truncation, such that $a \leq X \leq b$.

Then, $P(a \leq X \leq b)$ is:

enter image description here

where I am using the Prob function from the mathStatica package for Mathematica to do the nitty-gritties.

Then, the pmf of the doubly truncated random variable $X$ s.t. $a \leq X \leq b$, with pmf denoted $g(x)$, is:

enter image description here

Finally, we seek $\text{Var}_g(X)$:

enter image description here

All done. The solution output can be viewed LARGER here:

http://www.tri.org.au/se/varianceofdoublytruncatedBinomial.png

Quick Plot

Just to make sure the result makes sense, here is a quick plot of the solution just derived -- the variance of the doubly truncated Binomial -- when $n = 12, p = \frac34, b= 12$, as the lower bound $a$ increases from 0 to 12. The thin red horizontal line is the unconditional variance of the Binomial parent (i.e. $np(1-p)$ ), and the the blue dots are the variance of the doubly truncated model, as the lower bound $a$ increases. As one would expect, the variance of the bounded model should be smaller than the unconstrained model. All looks fine.

enter image description here

Notes

  1. The Prob and Var function used above are from the mathStatica package for Mathematica.

  2. The variance calculation took about 10 hours to compute on a 2014 R2-D2 Mac Pro, though much of this would have been 'simplification' time.

  3. Details on the Hypergeometric2F1 etc functions can be found here: http://reference.wolfram.com/language/ref/Hypergeometric2F1.html

$\endgroup$
2
  • 1
    $\begingroup$ (+1) I was so surprised at the ten hour calculation time that, to understand what the problem might be, I did this computation directly (from the definitions). A fresh kernel for Mathematica 9.0.1 completed it in 4.8 seconds on a four-year-old Windows 64 workstation. However, the expression it obtained for the numerator is a little more complicated (involving 21 hypergeometric function calls), so it looks like the extra ten hours of computation was used for simplification. $\endgroup$
    – whuber
    Commented Jul 21, 2014 at 13:11
  • 2
    $\begingroup$ @whuber Just had a quick look. Yes - almost all of the timing is FullSimplify. Under Mma 9, the total time is 15 minutes. Under Mma 10, the same calculation took 10 hours - aha (running overnight). There does seem to be some bug or problem with FullSimplify under the new Mma 10. $\endgroup$
    – wolfies
    Commented Jul 21, 2014 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.