Variance of a fitted regression mean (source code)

= Variance of a fitted regression mean
{title2=$\operatorname{Var}(v^T\widehat\beta)=\sigma^2v^T(X^TX)^{-1}v$}

For a full-column-rank <design matrix> in a <normal linear model>, a fitted mean at covariate vector $v$ is $v^T\widehat\beta$. The <covariance matrix> of the <least-squares estimator> immediately gives the displayed <variance>. Replacing $\sigma^2$ by the independent unbiased residual <variance> gives its squared <standard error> and a <Student t confidence interval> on $n-p$ <statistical degrees of freedom>. A future response instead contributes an additional error <variance> $\sigma^2$ when its error is independent of the fitted data.

// Target: probability-and-statistics.bigb