The Gaussian likelihood has log-likelihood, apart from no omitted parameter-dependent terms,For fixed , maximizing it is ordinary least squares. Differentiating with respect to gives the normal equation . Full column rank makes the quadratic strictly convex, soAt this value, differentiating with respect to gives , soFor positive RSS this is the global likelihood maximum in . RSS is positive almost surely under the model since ; an exactly zero observed RSS instead gives a boundary supremum as .
As a linear image of a multivariate normal vector, the coefficient estimate satisfiesIndeed, , and direct matrix multiplication gives its covariance matrix.
The fitted values are , so the hat matrix isIt is symmetric, andIt fixes every vector in the column space of , and annihilates its orthogonal complement. Thus is the orthogonal projection onto that column space, has matrix rank and trace , and is the complementary orthogonal projection. ConsequentlySince , the covariance matrix between the regression residual vector and the coefficient estimate isThese quantities have a joint normal distribution, so they are also independent, a stronger conclusion than zero covariance.
Now has mean zero. Using the expectation of a quadratic form,Thus the maximum-likelihood estimator hasThe unbiased alternative isThe orthogonal projection of a Gaussian vector also yields , explaining the residual degrees of freedom.
Let be sunny days and latitude. The R linear-model formula expands to a normal linear model with both main effects and their interaction term:The fitted conditional mean isThe residual standard error is , giving the usual variance estimate , and .
The estimated interaction term is tiny relative to its standard error: and the two-sided p-value is . A sensible initial simplification is to remove the interaction and refit an additive linear model,
lm(energy ~ sunny + latitude). Both main effects are significant in the supplied fit, and should initially be retained. Do not simply copy their old coefficient estimates into the new fit: removing a design column generally changes all estimates. Centering predictors makes intercepts and main-effect interpretations more useful, but does not change the fitted surface. The Box–Cox transformation in part (d) suggests a further response-scale improvement; after changing the response scale, reassess the interaction and diagnostics.The Box–Cox transformation searches over transformations of the positive response,The plotted horizontal coordinate is and the vertical coordinate is its maximized profile likelihood on the log scale. The likelihood includes the transformation Jacobian determinant; omitting it would compare response scales incorrectly. For the Gaussian regression it is, up to constants,The maximum occurs around . The horizontal 95% line is approximately , and its intersections give an approximate interval roughly to , read visually. In particular, is below the line, and is far below it.
Square the response: a convenient transformation is , equivalent up to affine rescaling to . Transform energy, not the sunny-days or latitude predictors. Refit and check the normal linear model on the transformed scale; the plot is evidence for a transformation, not proof that the transformed residual assumptions hold. Inference on transformed means cannot be inverted naively to obtain original-scale conditional means.
Check that the chosen mean structure adequately describes the transformed response. Examine the residual-versus-fitted plot and residuals versus each predictor: systematic curvature suggests omitted nonlinear effects or an interaction term. Plot residual spread against fitted values, for example using a scale-location plot, to assess homoscedasticity. Compare standardized residuals with a normal distribution using a quantile-quantile plot, especially for finite-sample Student's t-distribution and F-test inference.
Also check independence using the sampling design and residuals versus time, collection site, or other groups; spatially related photovoltaic systems may have correlated errors that are invisible in a residual-versus-fitted plot. Investigate large standardized regression residuals, high regression leverage, and influential observations using Cook's distance. Check that the design matrix has full rank and that severe multicollinearity is not making estimates unstable. Reassess whether the response transformation and retained predictors improve these diagnostics and prediction; a coefficient p-value alone cannot establish model adequacy. If observations are independent only conditional on site effects, use an appropriate dependence model rather than treating correlated systems as independent replicates.
Assume the known covariance matrix is positive definite. The Gaussian likelihood, up to constants, isIts gradient is . The negative Hessian matrix is positive definite because has full column rank. Thus the unique maximum-likelihood estimator is the generalized least squares estimatorIt is unbiased, and multiplication of its linear coefficient matrix by givesIn fact . Equivalently, a whitening transformation premultiplies and by , after which ordinary least squares applies. There is no extra factor when is the complete known covariance; such a factor appears if only a shape matrix is known and .
Articles by others on the same topic
There are currently no matching articles.