Proving that MLE is equal to LSE Assuming that $\epsilon \sim N(0, \sigma^2)$
I want to prove that the maximum likelihood estimator is equal to the least squares estimator. Now, I think I'm very close to making the proof, I just need some guidance.
MLE approach:
$y_i = \beta_0 +  \beta  X_i + \epsilon$ is the linear regression model, and we can get that $\epsilon = y_i -  \beta_0 - \beta X_i $, and we assume that $\epsilon \sim N(0,\sigma^2)$
Because we assume normality, we can get the density function, like this:
$$ f(X_i | \beta, \sigma^2) = (1 / 2\pi\sigma^2)^{n/2} e^{-(y_i - \beta_0 - \beta X_i)^2) / 2\sigma^2} $$
Now write the likelihood function:
$$ L =  \prod_{i=0}^{n} = (1 / 2\pi\sigma^2)^{n/2} e^{-(y_i - \beta_0 - \beta X_i)^2) / 2\sigma^2}$$
Take the log of the likelihood function:
$$ log L = n log (1/2\pi\sigma^2) - 1/2\sigma^2 \sum_{i=0}^{n}(Y_i - \beta_0 - \beta_iX_i)^2)$$
Now take the derivative:
$$∂ / ∂\beta = 2/2\sigma^2 \sum X_i (Y_i - \beta_0 - \beta X_i) = 0$$
And this is the final derivative that I got...
LSE approach:
I successfully found that the estimator for the least squares $\hat{\beta}$ and that is just the normal equation:
$$\hat{\beta} = (X^t X)^{-1}  * X^ty $$
Now how do I connect both approaches? what should I add to actually show these two are exactly the same estimator? I feel I did the hard part, but I'm missing the final touch.
Thanks all!


Take the log of the likelihood function:
$$ log L = n log (1/2\pi\sigma^2) - 1/2\sigma^2 \color{red}{\sum_{i=0}^{n}(Y_i - \beta_0 - \beta_iX_i)^2}$$

Wait a sec, don't you have the sum of squared residuals here?
