This is a question from an old exam-paper:
"Suppose that we have data $y = (y_1, . . . , y_n)$. Each data-point $y_i$ is assumed to be generated by a
distribution with the following probability density function:
$$p(y_i|\theta)=\frac{\theta^2}{y_i^3}e^{-\frac{\theta}{y_i}},y_i\ge0 $$
The unknown parameter is $\theta$, with $\theta>0$. Write down the likelihood for $\theta|y$. Find an expression for the maximum likelihood estimate $\hat{\theta}$."
My approach is as follows:
$$L(\theta;y) = \prod_{i=1}^n \frac{\theta^2}{y_i^3}e^{-\frac{\theta}{y_i}},y_i\ge0 $$
Now, $$\prod_{i=1}^n \theta^2=\theta^{2n}$$
$$\prod_{i=1}^n \frac{1}{y_i^3}=\frac{1}{(\prod y_i)^3} $$
and $$\prod_{i=1}^n e^{-\frac{\theta}{y_i}}=e^{-\theta \sum\frac{1}{y_i}} $$
So overall, $$L(\theta;y)=\theta^{2n} \frac{1}{(\prod y_i)^3} e^{-\theta \sum\frac{1}{y_i}}$$
The log-likelihood is $$\ell(\theta;y)=2n\ln(\theta) + \ln\left(\frac{1}{(\prod y_i)^3}\right) -\theta \sum\frac{1}{y_i}$$ Where all the products and sums happen over $i=1,2,3,\dots,n$.
Differentiating with respect to $\theta$:$$ \frac{d\ell}{d\theta}=\frac{2n}{\theta}-\sum\frac{1}{y_i}=0$$
This implies that $$\hat{\theta}=\frac{2n}{\sum\frac{1}{y_i}} $$
Is the likelihood and the MLE correct?