Find the method of moments estimator, MLE of $\theta$ and their MSE

109 Views Asked by At

Did I make any mistakes? I feel like my MLE is a bit messy and that I didn't use the fact that $0\le \theta\le 1/2$.

With $X_1,\ldots,X_n$ iid $f(x\mid \theta)=\theta^{x}(1-\theta)^{1-x},x=0 $ or $ 1,0\le \theta\le 1/2$

First I try:

Assume sample estimator: $\bar{X}=\frac{\sum_{i=1}^{N}x_i}{N}$ and $E(x)=\sum_{x=1,0}^{}x\theta^{x}(1-\theta)^{1-x}=0+\theta$

thus $\hat{\theta}=\bar{X}=\frac{\sum_{i=1}^{N}x_i}{N}$ is my moments estimate

With MSE:

$E([\frac{\sum_{i=1}^{N}x_i}{N}-\theta]^2)=var(\frac{\sum_{i=1}^{N}x_i}{N})+[E(\frac{\sum_{i=1}^{N}x_i}{N})-\theta]^2$

$=var(\frac{\sum_{i=1}^{N}x_i}{N})+[\theta-\theta]^2=var(\frac{\sum_{i=1}^{N}x_i}{N})$

For MLE

$ \prod_{i = 1}^{N} \theta^{x_i}(1-\theta)^{1-x_i}=\theta^{\sum_{}^{}x_i}\prod_{i = 1}^{N} (1-\theta)^{1-x_i}$

taking ln

$log(1-\theta)\sum_{}^{}(1-x_i)+ln(\theta)\sum_{}^{}x_i$

find at $\frac{d}{d\theta}=0$ for $\theta$, with $\frac{d}{d\theta}=\frac{\sum_{}^{}(x_i)}{\theta}-\frac{\sum_{}^{}(1-x_i)}{1-\theta}$

thus $\theta=\frac{\sum_{}^{}(x_i)}{\sum_{}^{}(x_i)+\sum_{}^{}(1-x_i)}$ is my MLE

With MSE:

$E([\frac{\sum_{}^{}(x_i)}{\sum_{}^{}(x_i)+\sum_{}^{}(1-x_i)}-\theta]^2)=var(\frac{\sum_{}^{}(x_i)}{\sum_{}^{}(x_i)+\sum_{}^{}(1-x_i)})+[E(\frac{\sum_{}^{}(x_i)}{\sum_{}^{}(x_i)+\sum_{}^{}(1-x_i)})-\theta]^2$

and

$\sum_{}^{}(x_i)+\sum_{}^{}(1-x_i)=N, $

$=var(\frac{\sum_{i=1}^{N}x_i}{N})$

And so they have the same MSE, but my method of moments estimator can have negative values whilst the MLE is always positive if $x_i$ is all positive or negative values. So the MLE is a better estimator right?

UPDATE

After fixing the sign mistakes picked up in comments, they are the same estimator.