Let $Y_1, \ldots , Y_n$ be a random sample from the uniform distribution on the interval $(0, \theta)$ with an unknown $\theta > 1$.
Suppose we only observe for $i = 1, \ldots , n$
$$X_i= \begin{cases} Y_i & \text{if } Y_i \leq 1, \\ 1 & \text{if } Y_i > 1. \end{cases}$$
Find the Method of Moments estimator of $\theta$ and derive its asymptotic distribution
So I found the expected value like usual when finding an MME, however I was unable to solve for $\theta.$ This is what I got:
$$ \operatorname{E}(X_i) = \frac{\theta-1} 2 +\frac 1 \theta$$
is my $\operatorname{E}(X_i)$ wrong? Because I can't seem to solve for $\theta$ when equating it to the sample mean
You have $$ X_i= \begin{cases} Y_i & \text{if } Y_i \leq 1, \\ 1 & \text{if } Y_i > 1. \end{cases} $$ Let $$ I_i= \begin{cases} 0 & \text{if } Y_i \leq 1, \\ 1 & \text{if } Y_i > 1. \end{cases} $$ Then $$ \operatorname{E}(X_i \mid I_i) = \left. \begin{cases} \dfrac 1 2 & \text{if } I_i=0 \\[6pt] 1 & \text{if } I_i=1 \end{cases} \right\} = \left. \begin{cases} \dfrac 1 2 & \text{with probability } \dfrac 1 \theta \\[6pt] 1 & \text{with probability } 1 - \dfrac 1 \theta \end{cases} \right\}. $$ Therefore $$ \operatorname{E}(X_i) = \operatorname{E}(\operatorname{E}(X_i\mid I_i)) = \frac 1 2 \cdot \frac 1 \theta + 1 \cdot \left( 1 - \frac 1 \theta \right) = \frac {1 + (2\theta - 2)} {2\theta} = \frac{2\theta -1}{2\theta} = 1 - \frac 1 {2\theta}. $$ Setting the sample mean equal to that, we have $$ \bar X = 1 - \frac 1 {2\theta} $$ $$ \frac 1 {2\theta} = 1-\bar X $$ and $$ \theta = \frac 1 {2(1-\bar X)}. $$