Least-squares regression via QR factorisation
Question
Explain how a QR decomposition is used to compute the least-squares coefficients minimising .
Short answer
Factor and solve . With having orthonormal columns and upper triangular, the normal equations reduce to , i.e. , solved by back-substitution. This avoids forming , whose condition number is the square of 's, so it is numerically more stable.
Adapted from Zhou, A Practical Guide to Quantitative Finance Interviews, sec. 3.6 Linear Algebra, 'QR decomposition and least squares', p.51; question and answer rewritten by SelfMadeQuant.com.
See the hint and the full worked solution in the question bank (free account).
Open the worked solutionLessons behind this question
- Eigenvalues and Eigenvectors: Ax = λx
- Simple Linear Regression: OLS Estimators and Geometry
- Multiple Linear Regression
Start with a free lesson: Basic Statistics and Regression is part of a free topic. Create a free account, no card needed, to read it in full with worked solutions.
Read it free