Residual estimate of Gaussian noise variance (source code)

= Residual estimate of Gaussian noise variance
{title2=$\widehat\sigma^2=\operatorname{RSS}/(n-p)$}

= Residual mean square
{synonym}

For a correctly specified full-rank fixed-design Gaussian <linear regression> with $p<n$, dividing the <residual sum of squares> by the <residual degrees of freedom> $n-p$ gives an <unbiased estimator> of the noise <variance>. The projection removes the whole deterministic mean, so the numerator's expectation is $(n-p)\sigma^2$. A misspecified subset model need not have this property.