In linear regression, how do the predicted values relate geometrically to the design matrix's column space?

Quick Overview

Asks for the geometric relationship between the fitted values of an ordinary least squares regression and the column space of its design matrix. Tests understanding of the hat matrix, residual orthogonality, the normal equations, and what changes when the columns are collinear.

In linear regression, how do the predicted values relate geometrically to the design matrix's column space?

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Other

In ordinary least squares with an $n \times p$ design matrix $X$ and response vector $y$, what is the geometric relationship between the vector of predicted values $\hat{y}$ and the column space of $X$? ```hint Pick the right space Work in $\mathbb{R}^n$, with one axis per observation. What set do all the vectors $X\beta$ form there, and where does $y$ sit relative to that set? ``` ### What a Strong Answer Covers - The operation that maps $y$ to $\hat{y}$ and the subspace it maps onto - How the residual vector relates to the columns of $X$, and the link to the normal equations - The matrix that performs the mapping and its main properties - Why this geometry means squared error is minimized - What changes when $X$ does not have full column rank ### Follow-up Questions - What are the eigenvalues and the trace of the hat matrix, and what do they mean for the model? - How do you read $R^2$ in this geometric picture? - What do the diagonal entries of the hat matrix tell you about individual observations? - Are ridge regression's fitted values still a projection of $y$? Why or why not?

Overview: Asks for the geometric relationship between the fitted values of an ordinary least squares regression and the column space of its design matrix. Tests understanding of the hat matrix, residual orthogonality, the normal equations, and what changes when the columns are collinear.

PracHub logo
General
Nov 24, 2026
mediumData ScientistOtherMachine Learning
0
0

In ordinary least squares with an n×pn \times p design matrix XX and response vector yy, what is the geometric relationship between the vector of predicted values y^\hat{y} and the column space of XX?

What a Strong Answer Covers Guidance

  • The operation that maps yy to y^\hat{y} and the subspace it maps onto
  • How the residual vector relates to the columns of XX , and the link to the normal equations
  • The matrix that performs the mapping and its main properties
  • Why this geometry means squared error is minimized
  • What changes when XX does not have full column rank

Follow-up Questions Guidance

  • What are the eigenvalues and the trace of the hat matrix, and what do they mean for the model?
  • How do you read R2R^2 in this geometric picture?
  • What do the diagonal entries of the hat matrix tell you about individual observations?
  • Are ridge regression's fitted values still a projection of yy ? Why or why not?