Multiply by to get the equivalent triangular system
For nonsingular , compute and use back substitution:
Orthogonal transformations preserve the Euclidean norm, making this a numerically stable reduction. The factors can be applied as stored Householder transformations without explicitly forming .
Since is invertible, is singular exactly when is singular. For an upper triangular matrix,
Thus a singular forces at least one zero diagonal entry in . In that case, ordinary division-based back substitution must be replaced by a consistency/rank analysis: the system may have no solution or infinitely many solutions, and a rank-revealing factorization can identify the free parameters.
Apply part (b) to the first column of , using the identity if it is already the zero vector. This gives an orthogonal matrix for which has zeros below its first diagonal entry. At stage , apply a Householder transformation to rows of column , and extend it by the identity on the first coordinates. If that trailing column is zero, again use the identity. The transformation preserves zeros in earlier columns, since their trailing entries already vanish.
After at most stages,
is an upper triangular matrix. Each is symmetric and orthogonal, so with
we have and
No invertibility assumption was used, so the Householder QR decomposition also exists for singular matrices.
Let , and choose if and otherwise. Set
This vector is nonzero, because has magnitude . Direct computation gives
so the Householder transformation satisfies
The first entry is nonzero and every other entry is zero. The sign choice also avoids cancellation when forming the first entry of , which is useful in numerical computation.
For , the Householder transformation is
Let . Then and , since is the orthogonal projection matrix onto the span of . Hence and
Thus is a symmetric matrix and an orthogonal matrix. Geometrically it reverses the component parallel to and fixes the perpendicular hyperplane.
By part (c), the best polynomial of degree at most is odd, hence has the form . The orthogonal projection condition with gives
The residual is odd, so its weighted inner products with the even polynomials and vanish automatically. Thus all three normal equations hold and
Define the reflected polynomial . It belongs to . Since is odd, a change of variable and the evenness of the weight give
Thus is another polynomial least-squares approximation. By uniqueness, , so
The conclusion includes the zero polynomial, which is both odd and even.
If is a minimizer, then for each the quadratic
has a minimum at , so . Conversely, if this orthogonality holds, then for every the Pythagorean theorem in the inner product space gives
Thus the minimizers are exactly the orthogonal projections characterized by
For existence, write . The conditions form the normal equations , with Gram matrix and . For every nonzero coefficient vector ,
Indeed a nonzero polynomial is nonzero on some open interval away from , where the weight is positive. Hence is a positive-definite matrix and is invertible, proving existence and uniqueness of . Uniqueness also follows from the preceding Pythagorean theorem identity. The zero of the weight at one point therefore causes no degeneracy on continuous functions or polynomials.
A polynomial least-squares approximation minimizes the weighted residual norm:
Equivalently it minimizes . This is a best approximation within a finite-dimensional polynomial space, without an interpolation requirement.
Let . Part (b) gives
The residual vector and coefficient estimator are independent: they are jointly normal and their cross-covariance matrix is zero, since . Hence is independent of . By the definition of Student's t-distribution,
Let be the quantile of this distribution. Inverting the central probability statement gives the exact marginal confidence interval
Its coverage is under the stated Gaussian linear model; simultaneous coverage for all coefficients would require a separate adjustment.
Use the residual mean square
To justify its denominator, let , the orthogonal projection matrix onto the column space of . Then the residual is . The idempotent matrix has rank , so diagonalizing it with an orthogonal matrix gives
Consequently , making an unbiased estimator. If specifically asked for maximum likelihood estimation, maximizing over gives the alternative , which is biased downward by the factor .
Write . Since ,
The errors have mean zero and covariance matrix . Therefore
Thus is an unbiased estimator. In addition, the multivariate normal distribution is preserved by linear maps, so is multivariate normal with the displayed mean and covariance matrix.
The Gaussian linear model has log likelihood function, up to an additive constant,
For each fixed positive , maximize this by minimizing the residual sum of squares. Differentiation gives the normal equations
The full column rank of makes positive definite, hence invertible, so
The quadratic objective is strictly convex, which proves uniqueness. The joint maximum-likelihood estimate has the same coefficient estimate, except on the probability-zero event of an exactly zero residual when the positive-variance likelihood has no finite joint maximizer.
The log likelihood ratio statistic comparing the unrestricted fit with the independence fit is
The unrestricted model has free parameters. Independence has , so the difference is . By Wilks theorem, under the null hypothesis the statistic has asymptotically a chi-squared distribution with degrees of freedom, rather than , , or .
For the supplied statistic, the approximate p-value is . Thus reject independence at the 5% level, but not at the 1% level: the data provide evidence of an association. The approximation is reasonable here; the smallest fitted cell count is , so all fitted counts exceed . The statistical hypothesis test concerns association, not a causal effect of personality.
Under independence, the log likelihood function separates:
Maximizing the two terms over their respective probability simplices, by the same Lagrange multiplier argument as in part (a), gives
Therefore the constrained maximum-likelihood estimates are
The associated fitted cell counts are .
Ignoring a factor independent of the parameters, the likelihood function is
Since every count is positive, a boundary value has zero likelihood. At an interior optimum, a Lagrange multiplier for gives . Summing the resulting gives , so
The log likelihood function is strictly concave on the positive simplex, because its Hessian matrix is diagonal with entries . Hence this critical point is the unique global maximum-likelihood estimate.

Pinned article: Introduction to the OurBigBook Project

Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
We have two killer features:
  1. topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculus
    Articles of different users are sorted by upvote within each article page. This feature is a bit like:
    • a Wikipedia where each user can have their own version of each article
    • a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
    This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.
    Figure 1.
    Screenshot of the "Derivative" topic page
    . View it live at: ourbigbook.com/go/topic/derivative
  2. local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:
    This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
    Figure 5. . You can also edit articles on the Web editor without installing anything locally.
    Video 3.
    Edit locally and publish demo
    . Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.
  3. https://raw.githubusercontent.com/ourbigbook/ourbigbook-media/master/feature/x/hilbert-space-arrow.png
  4. Infinitely deep tables of contents:
    Figure 6.
    Dynamic article tree with infinitely deep table of contents
    .
    Descendant pages can also show up as toplevel e.g.: ourbigbook.com/cirosantilli/chordate-subclade
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact