0
$\begingroup$

Thank you for your help. I want to compare binomial and normal distributions to prove to myself (numerically) how binomial distributions approach normal distributions as n increases. I know books say this, but I've never read how to prove it to myself (in R, sas, or by pencil). My guess is to create an x-vector of length "n" and generate a binomial-y-vector and a normal-y-vector and then compare the distance between the y-vectors generated. I'm sure that as "n" increases, the y-vector distances will decrease, but how do I measure this? My first thought was a basic sum of squares calculation (I, II, III?). I also noticed that the comparison will be affected by the length of the vector and not just the distance between y-vectors (longer vectors will naturally reduce the distance). Am I on the right track? How can I do this? again, thank you for the help!

$\endgroup$
4
  • 2
    $\begingroup$ I think that rather than doing a basic sum of squares, you'd want to use a Kolmogorov-Smirnov test, or one of the other tests that exists to compare distributions. You can generate a large vector of binomial random variables, then use Kolmogorov-Smirnov to test for normality. $\endgroup$ Jan 11, 2020 at 3:04
  • 2
    $\begingroup$ Are you trying to show that the distributions get closer together as n increases? (rather than samples from those distributions...) $\endgroup$
    – Glen_b
    Jan 11, 2020 at 5:41
  • $\begingroup$ Thanks! Since the binomial distribution approaches the normal at around n=20 (or so the books say), I want to be able to quantify this "approach" numerically. maybe start with a n=5 comparison and increase to n=100 or more. At the same time, measure in some way how the curves get closer to each other. One potential complication is that as the vectors get longer, their very length probably will contribute to them "getting closer" so instead, I'd probably keep the comparison fair by testing the "middle 10" values of the distributions, whether n=10 or n=100, just the middle 10. $\endgroup$
    – skaai
    Jan 11, 2020 at 6:07
  • $\begingroup$ The "curves" in question would be based on cumulative probability distributions. Graphs of probability functions do not get closer to graphs of probability density functions. (One might also carry out such an analysis using characteristic functions or continuous transformations thereof, such as cumulant generating functions, but those would be more difficult to interpret.) However, in this particular case histograms (which use areas rather than heights to represent probabilities) will converge: see stats.stackexchange.com/a/3904/919 for an illustration. $\endgroup$
    – whuber
    Jan 11, 2020 at 13:49

1 Answer 1

3
$\begingroup$

Assuming you want to visualize how the binomial approaches the normal as n grows I'd do it as follows:

  1. Choose some value for the second parameter, $p$ (like say 0.5 or 0.2)

  2. draw a standard normal cdf and compute and plot the cdf of a standardized binomial at some $n=n_1$

  3. draw a standard normal cdf and compute and plot the cdf of a standardized binomial at some $n=n_2>>n_1$

  4. draw a standard normal cdf and compute and plot the cdf of a standardized binomial at some $n=n_3>>n_2$

You can try various values for p and for the different n's.

Something like this:

Plot of standardized binomial and standard normal cdf for p=0.5 and n=10, 40 and 160

(though ideally you'd mention the value of p somewhere as well; I'll leave prettying things up like that to you though)

par(mfrow=c(1,3))
p=0.5
curve(pnorm,-3,3,main="binomial cdf vs normal cdf, n=10")
n=10;x=0:n
plot(stepfun((x-n*p)/sqrt(n*p*(1-p)),c(0,pbinom(x,n,p))),
       verticals=FALSE,add=TRUE,col=4)
curve(pnorm,-3,3,,main="binomial cdf vs normal cdf, n=40")
n=40;x=0:n
plot(stepfun((x-n*p)/sqrt(n*p*(1-p)),c(0,pbinom(x,n,p))),
       verticals=FALSE,add=TRUE,col=4)
curve(pnorm,-3,3,main="binomial cdf vs normal cdf, n=160")
n=160;x=0:n
plot(stepfun((x-n*p)/sqrt(n*p*(1-p)),c(0,pbinom(x,n,p))),
       verticals=FALSE,add=TRUE,col=4)

[Some people find it more intuitive to compare the binomial pmf with the normal density but you have to be quite careful when doing that to be clear about what it is that you're comparing, because it's important to understand that density is not probability, and if you're not careful you can easily find yourself comparing things that are not similar.]

$\endgroup$
1
  • $\begingroup$ Thank you so much! I learned something new (step functions) while parsing your answer. The thing is I want to quantify the differences between the binomial and the normal functions. for example, n=5 y1=dbinom, y2=dnorm, then compare the differences. then for n=10 do the same. then for n=20 do the same, and so on. The only complication I see is that while n needs to grow, i probably need to only measure the 10 "middle" values of each test to keep the lengths of the vector from affecting the result. This gives me a numerical value that should get smaller as n gets larger. $\endgroup$
    – skaai
    Jan 11, 2020 at 7:57

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.