Expanding the ordinary least squares objective givesFor a nonzero vector , , since the design matrix has matrix rank . The Hessian matrix is therefore positive-definite, and is strictly convex. Solving its normal equations gives the unique least-squares estimator:Indeed, expansion about this stationary point and give , which also proves the global minimum directly.
Define the hat matrix . It is a symmetric matrix and an idempotent linear map, since and , and its image is the column space of . Thus is the orthogonal projection onto the fitted mean space. The fitted values are and the regression residual vector is . Because is also a symmetric matrix and an idempotent linear map,These minimization and projection identities do not need errors with a normal distribution; the normal linear model becomes relevant to the distributional calculations.
Put . Since , the regression residual vector is . A linear transformation of a multivariate normal distribution is again multivariate normal, soThis is a singular multivariate normal distribution supported on , with dimension . In particular,Consequently regression residuals are neither independent nor identically distributed even under the stated model. Their linear constraints include , and, if the design matrix contains an intercept, their sum is zero.
Choose an orthonormal basis of the residual space. The coordinates of in that basis are independent variables, provingFor , is an unbiased estimator of . Orthogonality of and gives zero cross-covariance, so the Gaussian fitted and residual vectors are independent. This explains why an appropriate residual-versus-fitted diagnostic has no systematic mean relationship under the model. If , no residual information remains for these diagnostics or the variance estimate.
For , use standardized regression residuals to account for the different residual variances. The diagonal is the regression leverage; makes that residual identically zero and cannot be diagnosed by this standardization. With known , the corresponding individually standardized residual has an exact standard normal distribution. With estimated , the internally studentized residual is not exactly normal or a Student t-distribution, and the residuals remain correlated; a normal reference plot is a diagnostic approximation.
Plot the regression residuals or standardized regression residuals against fitted values and each covariate. A persistent curve suggests a misspecified mean, while a fan-shaped spread suggests heteroscedasticity; a scale-location plot helps separate these. A quantile-quantile plot against normal quantiles checks tails, skewness and possible regression outliers. Plot residuals against observation order or time to look for unexplained serial patterns, recognizing that projection already induces the displayed residual covariances. Inspect regression leverage together with Cook's distance for influential observations. Such patterns motivate revising the model; absence of a visible pattern does not prove all its assumptions.
The response errors have standard deviations proportional to . Thus, when fitted means approximate the true means, increasing absolute fitted values tends to accompany increasing residual spread. A residual-versus-fitted plot shows a fan for positive means, or spread increasing away from zero for means of either sign. Standardization by one common residual standard deviation, even with the usual regression leverage correction, does not remove this systematic heteroscedasticity.
Under independent errors the exact covariance matrix after fitting iswhere is the common proportionality constant. Hence the simple fan description is a diagnostic tendency, not an assertion that each fitted residual has exactly variance .
For positive responses, the intended variance-stabilizing transformation is the natural logarithm. The delta method givesUse for positive data with modest relative error, then refit and check the transformed mean and residual structure. In particular, if the original mean was , the transformed mean is approximately , not automatically a linear function of the original covariates.
There is a domain qualification in the literal printed model: a nondegenerate normal distribution has negative support. For positive , the probability of is , so a real is not defined throughout the stated sampling model. When is small this is a negligible-tail approximation, not an exact transformation to normal errors. If signed values must be retained and all , write with standard normal . ThenThe second term has a common distribution with finite variance, so log absolute value stabilization of a normal scale family is exact, but loses the sign of the mean and does not produce normal errors. Zeros and a zero mean are excluded from this transform. Alternatively retain the response scale and fit the stated variance model with weighted least squares weights proportional to where the means stay away from zero. No arbitrary addition of a constant before taking logarithms exactly solves the given variance relation.
Articles by others on the same topic
There are currently no matching articles.