# How to find the OLS estimator of variance of error

Given the Linear Regression model $$y=X\beta+\epsilon$$, where $$\epsilon \sim D(0_n,\sigma^2 I_n)$$ and $$D$$ is some distribution. How to find the OLS estimator of $$\sigma^2$$.

I know that the sum of least-squares residuals has a distribution equal to $$\sigma^2$$ times $$\chi^2_{n-1}$$. So I can therefore determine the unbiased estimator of $$\sigma^2$$. But how to prove that sum of least-squares residuals follows such distribution. Also anyone with new way to find it are welcome.

• In $D(0_n,\sigma^2 I_n)$, if $0_n$ is the mean and $\sigma^2$ = variance, which kind of distributions meet this condition, apart from normal? – user158565 Oct 9 '18 at 0:22

• Yeah so what i have written is correct? i.e., RSS $\sim \sigma^2*\chi^2_{n-1}$. So, E(RSS)=$\sigma^2*(n-1)$ and thus we can derive the estimator for $\sigma^2$ right? I'm not sure of the $n-1$ part. $\beta$ isn't a scalar, so should it be $n-k$ where $\beta$ is $k\times 1$ matrix? – Aatsrh Oct 9 '18 at 2:19