What are normal equations, and when are they used in the context of solving linear systems or least squares?

Quick Overview

Asks what the normal equations are, how they arise from a least squares problem, and when to use them for linear systems and regression. Tests the derivation, the conditions for a unique solution, and the numerical trade-offs against QR and SVD.

What are normal equations, and when are they used in the context of solving linear systems or least squares?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

What are the normal equations, and when are they used in the context of solving linear systems or least squares problems? Explain where they come from, when they give a unique solution, and when you would avoid them in practice. ```hint Start from the objective Write down the least squares objective $\|Ax - b\|^2$ and set its gradient to zero. Then think about what that condition says geometrically about the residual. ``` ```hint Think about numerics Compare the condition number of $A$ with that of the matrix you end up solving with. ``` ### What a Strong Answer Covers - The normal equations themselves and a derivation, either from the gradient or from orthogonality of the residual - The condition under which the solution is unique, and what happens when it is not - The kinds of problems they are used for, including regression - The numerical cost of forming the product matrix, and which factorizations are preferred instead - When the normal equations are still a reasonable choice ### Follow-up Questions - How do the normal equations change for ridge regression or weighted least squares? - If $A$ has linearly dependent columns, which least squares solution does the SVD return, and why is it a natural choice? - How would you fit a least squares model on data too large to hold in memory? - For an underdetermined system with more unknowns than equations, how do you find the solution with the smallest norm?

Overview: Asks what the normal equations are, how they arise from a least squares problem, and when to use them for linear systems and regression. Tests the derivation, the conditions for a unique solution, and the numerical trade-offs against QR and SVD.

Nov 25, 2026
mediumData ScientistOtherStatistics & Math
0
0

What are the normal equations, and when are they used in the context of solving linear systems or least squares problems? Explain where they come from, when they give a unique solution, and when you would avoid them in practice.

What a Strong Answer Covers Guidance

  • The normal equations themselves and a derivation, either from the gradient or from orthogonality of the residual
  • The condition under which the solution is unique, and what happens when it is not
  • The kinds of problems they are used for, including regression
  • The numerical cost of forming the product matrix, and which factorizations are preferred instead
  • When the normal equations are still a reasonable choice

Follow-up Questions Guidance

  • How do the normal equations change for ridge regression or weighted least squares?
  • If AA has linearly dependent columns, which least squares solution does the SVD return, and why is it a natural choice?
  • How would you fit a least squares model on data too large to hold in memory?
  • For an underdetermined system with more unknowns than equations, how do you find the solution with the smallest norm?