4 ms·
> Since all outcomes are 0 or 1, and drawn with the same (unknown) probability, we know that the number of ones and zeros follows a binomial distribution. This
by clircle 8y ago
> Since all outcomes are 0 or 1, and drawn with the same (unknown) probability, we know that the number of ones and zeros follows a binomial distribution. This means that the confidence interval of a “k out of n” scenario is a Beta distribution.
Pretty confused by this sentence. The mean of a bunch of 0s and 1s cannot follow a beta distribution. The support set is not continuous. I think the author is making Clopper-Pearson intervals, but dropping some terms.
- chewbaxxa 8y agoThe author probably means that the unknown probability follows a beta distribution. Then you can construct confidence intervals for p the usual way.
- ezke 8y agoThe beta dist is conjugate to the binomial, it is a natural prior for the proportion parameter. The mean of a bunch of 0s and 1s will be between [0,1], the support of the beta dist.
- clircle 8y agoThe mean of n 0s and 1s has support {0, 1/n, 2/n, ..., n/n}, not [0,1]. >The beta dist is conjugate to the binomial, it is a natural prior for the proportion parameter. I don't think the author is doing Bayesian inference.
- c_moscardi 8y agoYep, my read too. The code he provides is definitely the Clopper-Pearson formula. [1] This confused me as well, since I've always used the normal central-limit-based confidence interval for binary outcomes. [1] https://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval#Clopper%E2%80%93Pearson_interval https://en.wikipedia.org/wiki/Binomial_proportion_confidence... (I am no expert in the analytic underpinnings of the beta distribution or precisely how it is the conjugate prior to the binomial -- or, rigorously speaking, what conjugate prior means -- but the formula here lines up with his formula :P )