Have I made mistakes? I feel like my MLE is a little messy and I have not used the fact that $ 0 theta the 1/2 $.

With $ X_1, …, X_n $ iid $ f (x | theta) = theta ^ {x} (1- theta) ^ {1-x}, x = 0 $ or $ 1,0 the theta the $ 1/2

First I try:

Suppose a 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 $

So $ hat { theta} = bar {X} = frac { sum_ {i = 1} ^ {N} x_i} {N} $ is my estimation moments

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}} prod_ {i = 1} ^ {N} (1- theta) ^ {1-x_i} $

take ln

$ log (1- theta) sum _ {} ^ {} (1-x_i) + ln ( theta) sum _ {} ^ {} x_i $

will find $ frac {d} {d theta} = $ 0 for $ theta $with $ frac {d} {d theta} = frac { sum _ {} ^ {} (x_i)} { theta} + frac { sum _ {}} {{} (1-x_i)} {1- theta} $

So $ theta = frac { sum _ {} ^ {} (x_i)} { sum _ {} ^ {} (x_i) – sum _ {} ^ {} (1-x_i)} $ is my daughter

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 ESM, but my method estimator of moments can have negative values while the MLE is always positive if $ x_i $ is all positive or negative values. The MLE is therefore a better estimator, is not it?