最小二乘回归算法
Least Squares via QR Decomposition
题目详情
给出一个线性最小二乘回归的算法(求 )。
Every invertible matrix can be written as where is orthogonal () and is upper triangular.
One constructs by applying Gram-Schmidt to the columns of and arises from the combination coefficients.
Least squares: If is we can do (where is is ) to solve . Then
Question: Give an algorithm for linear least squares regression.
解析
标准做法:
- 对设计矩阵 做 QR 分解 ( 列正交, 上三角)。
- 由正规方程等价变换:
- 用回代解上三角方程得到 。
相比直接解 ,数值更稳定。
Original Explanation
We have . Minimize The normal equations are Instead of inverting factor and solve