Skip to content
Financial Machine Learning / Foundations: The Learning Problem and Linear Regression

Derivation — The Normal Equations via Matrix Calculus

The parent note stated ∇θJ(θ)=X⊤Xθ−X⊤y\nabla_\theta J(\theta) = X^\top X\theta - X^\top y without proof. This note supplies the matrix-derivative machinery — the trace trick — needed to differentiate a matrix expression like ∥Xθ−y∥2\|X\theta - y\|^2 with respect to a vector θ\theta, the same technique reused later for ridge regression's closed form and the PCA maximum-variance derivation.

In this lesson

  1. Learning objectives
  2. Matrix derivatives
  3. Derivation of the normal equations

Before you start

The full lesson, with worked examples and exercise solutions, is for members.

Read the full lesson

New to SelfMadeQuant.com? See membership options or browse the Financial Machine Learning syllabus.