What is orthogonal projection onto a subspace and how does it connect to least squares?

Quick Overview

Asks what orthogonal projection onto a subspace is and how it connects to least squares. Tests the projection matrix and its properties, the orthogonal residual condition, the normal equations, and how to solve least-squares problems in a numerically stable way.

What is orthogonal projection onto a subspace and how does it connect to least squares?

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

What is orthogonal projection onto a subspace and how does it connect to least squares? ```hint Look at the leftover Write $b$ as a vector inside the subspace plus whatever is left over. Ask what must be true of the leftover for the piece inside the subspace to be the closest point to $b$. ``` ```hint Turn the condition into equations Being orthogonal to a subspace spanned by the columns of $A$ means being orthogonal to each column. Write that as one matrix equation. ``` ### What a Strong Answer Covers - The definition of orthogonal projection and why the projection is the closest point in the subspace - The projection matrix onto a column space and its algebraic properties - The orthogonality condition on the residual and how it leads to the normal equations - How the least-squares solution and its fitted values relate to the projection - How to solve the problem stably in practice ### Follow-up Questions - What changes when the columns of $A$ are linearly dependent? - What does $I - P$ project onto, and what is the trace of $P$? - In linear regression, what are the diagonal entries of the hat matrix, and why do they matter? - How does weighted least squares change the projection?

Overview: Asks what orthogonal projection onto a subspace is and how it connects to least squares. Tests the projection matrix and its properties, the orthogonal residual condition, the normal equations, and how to solve least-squares problems in a numerically stable way.

PracHub logo
General
Nov 25, 2026
mediumData ScientistOtherStatistics & Math
0
0

What is orthogonal projection onto a subspace and how does it connect to least squares?

What a Strong Answer Covers Guidance

  • The definition of orthogonal projection and why the projection is the closest point in the subspace
  • The projection matrix onto a column space and its algebraic properties
  • The orthogonality condition on the residual and how it leads to the normal equations
  • How the least-squares solution and its fitted values relate to the projection
  • How to solve the problem stably in practice

Follow-up Questions Guidance

  • What changes when the columns of AA are linearly dependent?
  • What does I−PI - P project onto, and what is the trace of PP ?
  • In linear regression, what are the diagonal entries of the hat matrix, and why do they matter?
  • How does weighted least squares change the projection?