Linear Systems and Least Squares

Regression is the tool researchers use most, and interviewers test the linear algebra underneath it: "derive the least squares estimator", "what does the normal equation mean geometrically?", "why not just invert the matrix?". The answers follow from one picture. The fitted values are the closest point to the data that the model can reach, and the residual points straight away from everything the model can express.

Linear systems

A system Ax=bAx = b with a square matrix AA has exactly one solution when AA has full rank. When AA is rank-deficient, the system has either no solution or infinitely many, depending on bb.

Regression is the other case: more equations than unknowns. With nn observations and pp coefficients, n>pn > p, the system Xβ=yX\beta = y usually has no exact solution, because nn data points do not lie exactly on a pp-parameter model. So we choose the β\beta that makes the error as small as possible.

The rest of this lesson is for subscribers

Unlock every lesson in Basics of Quantitative Finance, and every other premium course.

Subscribe to continue

Test your knowledge

Questions are only available to subscribers.

Keep reading Basics of Quantitative Finance

30 lessons in this course, and every other premium course, on one subscription.

  • Every lesson in every course, with the worked examples and interactive simulators
  • Graded questions on every lesson, with explanations for the wrong answers as well as the right one
  • The trainers, timed assessments and brainteaser library that go with them