How to implement the Generalized Method of Moments for the upper limit of a uniform? Suppose $\{Y_1,\ldots,Y_n\}$ are iid uniform on $[0,\theta]$ where $\theta$ is the unknown parameter.
I'm trying to understand how to create a GMM estimator for $\theta$ and I'm not really sure how. I know I can use $E(Y-\frac{\theta}{2}) = E(Y^2 - \frac{\theta^2}{3})=0$ but once again I'm confused as to how to create an efficiently weighted GMM estimator.
 A: The sample equivalents of your moment conditions are
$$
g_1 = \frac{1}{n}\sum_{i=1}^n \left(Y_i - \frac{\theta}{2}\right)
$$
and
$$
g_2 = \frac{1}{n}\sum_{i=1}^n \left(Y_i^2 - \frac{\theta^2}{3}\right)
$$
By changing $\theta$, you can in general not set both conditions equal to zero simultaneosuly. The idea of GMM is to still take both conditions into account in the estimation process. The procedure works like this: stack $g_1$ and $g_2$ into the vector $g$ and minimize its weighted quadratic form:
$$
\hat{\theta} = \arg \min_\theta g'Wg
$$
With $W$ the weighting matrix. You can just set $W = I$, but the efficient choice is to set it equal to the inverse of the covariance matrix of $g$, $\Sigma_g^{-1}$. Since the latter depends on the unknown $\theta$, you proceed iteratively: first compute $\hat{\theta}$ using $W_0 = I$, then setting $W_1 = \Sigma_g^{-1}$, recomputing $\hat{\theta}$ and $W_2$ and so on. You continue until $\hat{\theta}$ converges, which should typically happen after five steps or so. This is also called $k$-step GMM. An extension to higher moments should be straightforward.
