estimated standard error for mean of Bernoulli random variables

378 Views Asked by At

I know that if $X_1,...X_n$ are Bernoulli(p) then to calculate the estimated standard error is $$\hat \sigma_{\bar X_n}= \sqrt{\frac{\frac{1}{n-1} \sum_i (\bar X_n - X_i)^2} {n}}$$ however, often, I see that we simply replace the sample mean in the standard error formula $\sqrt{\frac{p (1-p)}{n}}$ which results in:$$\hat \sigma_{\bar X_n}= \sqrt {\frac{\bar X_n (1- \bar X_n) }{n}}$$ are these two the same?if so, how do we show that they are the same?

1

There are 1 best solutions below

1
On

Since each $X_i \in \{0,1\}$, we observe that $X_i^2 = X_i$ for each $i = 1, 2, \ldots, n$. I will use the notation $$\bar X = \frac{1}{n} \sum_{i=1}^n X_i.$$ Equivalently, $$\sum_{i=1}^n X_i = n \bar X.$$

Then $$\begin{align} \sum_{i=1}^n (X_i - \bar X)^2 &= \sum_{i=1}^n \left( X_i^2 - 2\bar X X_i - \bar X^2 \right) \\ &= \sum_{i=1}^n X_i - 2\bar X \sum_{i=1}^n X_i + n \bar X^2 \\ &= n \bar X - 2 \bar X (n \bar X) + n \bar X^2 \\ &= n \bar X - n \bar X^2 \\ &= n \bar X (1 - \bar X). \end{align}$$

It follows that $$\frac{1}{n(n-1)} \sum_{i=1}^n (X_i - \bar X)^2 = \frac{\bar X (1 - \bar X)}{n-1}.$$

We can see that if we had used the biased, Bessel-uncorrected sample variance, which is the maximum-likelihood estimate for the variance, $$\hat \sigma^2 = \frac{1}{n} \sum_{i=1}^n (X_i - \bar X)^2$$ rather than the unbiased, Bessel-corrected sample variance $$s^2 = \frac{1}{n-1} \sum_{i=1}^n (X_i - \bar X)^2,$$

then the two formulas would be equivalent. Specifically,

$$\frac{\hat \sigma}{\sqrt{n}} = \sqrt{\frac{\bar X(1-\bar X)}{n}},$$ but $$\frac{s}{\sqrt{n}} = \sqrt{\frac{\bar X (1-\bar X)}{n-1}}.$$