Estimating the Error Variance

The least squares principle does not provide for a parameter estimator for $\sigma ^2$. The usual approach is to use a method-of-moments estimator that is based on the sum of squared residuals. If the model is correct, then the mean square for error, defined to be $\mr {SSR}$ divided by its degrees of freedom,

$\displaystyle  \widehat{\sigma }^2  $
$\displaystyle = \frac{1}{n-\mr {rank}(\bX )} \left(\bY -\bX \widehat{\bbeta }\right)’ \left(\bY -\bX \widehat{\bbeta }\right)  $
$\displaystyle  $
$\displaystyle = \mr {SSR}/(n-\mr {rank}(\bX ))  $

is an unbiased estimator of $\sigma ^2$.