# Method-of-moments estimator for a uniform distribution

I have a sample of data points independently sampled from a uniform distribution with a density function $$f(x)=\frac{1}{a}, 0\leq x \leq a$$.

I need to use the method of moments to estimate $$a_{mom}$$.

My idea is to just calculate the variance, then multiply by 12 and take the square root so I get $$b-a$$. Then I'm kind of stumped what to do further.

An easier method-of-moments estimator arises from considering the mean. Notice that $$E(X) = \frac{a}{2}$$, so that one can take $$\hat{a}_{MoM} = 2 \overline{X}$$ as an estimator. Your approach would also work, since we have $$\operatorname{Var}(X) = \frac{a}{12}$$ so that $$a_{MoM}^\prime = 12 \hat{S}^2$$ where $$\hat{S}^2$$ is the sample variance.