I have the pdf of a triangular random variable: $$f_x(x;a) = \frac{2x}{a^2} \ \ \ \ , \ \ \ \ 0<x<a$$ And I need to estimate parameter $a$
Maximum Likelihood
If I say that the likelihood function is the same as the pdf (I know this is not true, but I don't know another thing to say), then:
$$p(x|a) = \frac{2x}{a^2}$$
Having $X=(x_1, x_2, \dots, x_N)^T$:
$$p(X|a) = \prod_{i=1}^{N} \frac{2x_i}{a^2}$$
and I have to maximize that. $a$ is fixed, so to maximize that, $a$ has to be the minimum possible, but $x_i<a$, so $x_i$ is better if it's maximum.
:S
Method of moments
$$E[X] = \int_{-\infty}^{\infty} x f_x(x) dx = \int_{0}^{a} x \frac{2x}{a^2} dx = \frac{2}{3} a$$ $$E[X] = \frac{1}{N} \sum_{i=1}^{N} x_i$$
So,
$$\hat{a} = \frac{3}{2} \frac{1}{N} \sum_{i=1}^{N} x_i$$
Is that ok?
The method of moments estimator is fine, while for MLE just note that $0 \le X_{(1)} \le ... \le X_{(n)} \le \alpha $, thus in order to maximize the likelihood function you have to take the smallest value of $\alpha$ that is possible, which is given by $X_{(n)}$, i.e., $$ \hat{a}_n = X_{(n)}. $$
Note that the support of $X$ should include $a$, i.e., $X\in [0, \alpha]$, otherwise $X_{(n)}$ will lie outside of the parametric space and thus it can't be an MLE.