Unbiased estimator of variance of binomial variable

$Y_{1…n}\sim \operatorname{Bin}(1,p)$, iid, and I need to find an unbiased estimator for $\theta=\operatorname{var}(y_i)$.

I did some calculations and I think that the answer is $p(1-p)-\frac{p(1-p)}{n}$

• Is this correct?
• If not, how can I find an unbiased estimator?

This answer cannot be correct. An estimator cannot depend on the values of the parameters: since they are unknown it would mean that you cannot compute the estimate.

An unbiased estimator of the variance for every distribution (with finite second moment) is

$$S^2 = \frac{1}{n-1}\sum_{i=1}^n (y_i – \bar{y})^2.$$

By expanding the square and using the definition of the average $\bar{y}$, you can see that

$$S^2 = \frac{1}{n} \sum_{i=1}^n y_i^2 – \frac{2}{n(n-1)}\sum_{i\neq j}y_iy_j,$$

so if the variables are IID,

$$E(S^2) = \frac{1}{n} nE(y_j^2) – \frac{2}{n(n-1)} \frac{n(n-1)}{2} E(y_j)^2.$$

As you see we do not need the hypothesis that the variables have a binomial distribution (except implicitly in the fact that the variance exists) in order to derive this estimator.