ML estimator for chi square distribution Suppose $Y_i$ has normal distribution with mean $\mu$ and variance $\sigma^2$ then
$$\dfrac{\sum( Y_i - \bar{Y})^2}{\sigma^2} \sim \chi^2(n-1)$$
It's a fact that the the ML estimator ($\sigma_{MLE}^2$) for $\sigma^2$ is  $$\dfrac{\sum (Y_i - \bar{Y})^2}{n}.$$
Edited the ML estimator
Can someone please show this, I have no clue how to derive this. I tried setting up the ML equations but it I am getting nowhere from there.
$$\log (L(\sigma^2;y)) = \log[\sum (y_i-\bar{y_i})^2] - \log(\sigma^2)$$
but taking the derivative wrt. $\sigma^2$ of $\log (L(\sigma^2;y))$ will make the first term disappear. After setting the resulting expression to zero, I am left with $-\dfrac{1}{\sigma^2} = 0$.
I must be missing something fundamental.
 A: The problem is that you haven't written down the correct likelihood.
Suppose $X$ is a positive multiple $\theta$ ($=\sigma^2$) of a variable $Y$ with distribution function $F_Y$ and density $f_Y$.  To find the density of $X$ itself, resort to the definition of the distribution function:
$$F_X(x) = \Pr(X\le x) = \Pr(\theta Y \le x) = \Pr(Y \le x/\theta) = F_Y\left(\frac{x}{\theta}\right).$$
The density of $X$ therefore is
$$f_X(x) = \frac{d}{dx} F_X(x) = \frac{d}{dx} F_Y\left(\frac{x}{\theta}\right)=\frac{1}{\theta}f_Y\left(\frac{x}{\theta}\right).$$
You mustn't forget the factor of $1/\theta$.  Let's see how it works out.
Suppose we observe $X=x$.   (In the application, this observation is the statistic $x = \sum_{i=1}^n (y_i-\bar y)^2$ from $n$ iid Normal variates $Y_i$ with realizations $y_i$.)  As usual, let's minimize the likelihood by differentiating the logarithm and setting that to zero:
$$0 = \frac{d}{d\theta}\log\left(\frac{1}{\theta} f_Y\left(\frac{x}{\theta}\right)\right)=-\frac{1}{\theta} - \frac{x}{\theta^2} \left(\log f_Y\right)^\prime\left(\frac{x}{\theta}\right).\tag{1}$$
For a $\chi^2(n-1)$ distribution, $$\log(f_Y(y)) = C + \frac{n-3}{2}\log(y) - \frac{y}{2}$$ where $C$ does not depend on $y$. Its derivative is $$(\log f_Y)^\prime(y) = \frac{n-3}{2y} - \frac{1}{2}.\tag{2}$$
Plugging $y=x/\theta$ into $(2)$ and evaluating $(1)$ produces
$$0 = -\frac{1}{\theta} - \frac{x}{\theta^2}\left( \frac{n-3}{2x/\theta} - \frac{1}{2}\right)$$
with the unique solution $$\hat\theta = \frac{x}{n-1} = \frac{\sum_{i=1}^n(y_i-\bar y)^2}{n-1},$$ as claimed.
