Set up the Gaussian likelihood for a linear model and show that maximizing it gives least squares

Quick Overview

Asks you to write the likelihood of a linear regression model with independent Gaussian errors and show that maximizing it gives ordinary least squares. Tests the log-likelihood derivation, the normal equations, and the bias of the variance MLE.

Set up the Gaussian likelihood for a linear model and show that maximizing it gives least squares

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

Set up the likelihood for a linear model with i.i.d. Gaussian errors and show why maximizing it reduces to minimizing the sum of squared residuals. ```hint Start from one observation Write the density of a single $y_i$ given $x_i$, multiply n of them together, and take the log. Then look at which terms contain $\beta$. ``` ### What a Strong Answer Covers - The model and the conditional distribution of each response - The likelihood as a product of densities, and the log-likelihood written out - Which terms of the log-likelihood depend on the coefficients, and whether the maximizing coefficients depend on the error variance - The resulting estimator from the normal equations, and when it exists - The variance MLE and whether it is unbiased ### Follow-up Questions - Is the MLE of the error variance unbiased? If not, what estimator corrects it? - If the errors followed a Laplace distribution, what loss would maximum likelihood minimize? - How does the derivation change if each observation has its own known error variance? - What estimator do you get if you also put a zero-mean Gaussian prior on the coefficients and maximize the posterior?

Overview: Asks you to write the likelihood of a linear regression model with independent Gaussian errors and show that maximizing it gives ordinary least squares. Tests the log-likelihood derivation, the normal equations, and the bias of the variance MLE.

General logo
General
Nov 24, 2026
mediumData ScientistOtherStatistics & Math
0
0

Set up the likelihood for a linear model with i.i.d. Gaussian errors and show why maximizing it reduces to minimizing the sum of squared residuals.

What a Strong Answer Covers Guidance

  • The model and the conditional distribution of each response
  • The likelihood as a product of densities, and the log-likelihood written out
  • Which terms of the log-likelihood depend on the coefficients, and whether the maximizing coefficients depend on the error variance
  • The resulting estimator from the normal equations, and when it exists
  • The variance MLE and whether it is unbiased

Follow-up Questions Guidance

  • Is the MLE of the error variance unbiased? If not, what estimator corrects it?
  • If the errors followed a Laplace distribution, what loss would maximum likelihood minimize?
  • How does the derivation change if each observation has its own known error variance?
  • What estimator do you get if you also put a zero-mean Gaussian prior on the coefficients and maximize the posterior?