Joint distribution of least-squares and variance estimators (source code)

= Joint distribution of least-squares and variance estimators
{title2=$\widehat\beta\perp\widehat\sigma^2$}

With a full-column-rank $n\times p$ design and isotropic normal errors, <ordinary least squares> gives $\widehat\beta\sim N_p(\beta,\sigma^2(X^TX)^{-1})$, independent of the residual squared length. Orthogonal design and residual projections of the <multivariate normal distribution> are independent, and $\operatorname{RSS}/\sigma^2\sim\chi^2_{n-p}$. The maximum likelihood variance estimate is $\operatorname{RSS}/n$, not the unbiased estimate $\operatorname{RSS}/(n-p)$.