##### 最小二乘解
- 最小二乘解
- **最小二乘解** $\hat{\mathbf{x}}$ 是[[线性方程组]] $A \mathbf{x} = \mathbf{b}$ 无法精确求解时, 使得 $A \mathbf{x}$ 最接近 $\mathbf{b}$ 的近似解, 即对所有 $\mathbf{x}$ 有 $||\mathbf{b}-A\hat{\mathbf{x}}||\leq||\mathbf{b}-A\mathbf{x}||$. 设 $\hat{\mathbf{b}}$ 为 $\mathbf{b}$ 在值域即[[列空间]] ${\rm Col}A$ 上的[[正交投影]], 则 $A\hat{\mathbf{x}}=\hat{\mathbf{b}}$ 是距离值域最近的点, 其中 $\hat{\mathbf{x}}$ 就是 $A\mathbf{x}=\mathbf{b}$ 的最小二乘解. 由正交投影有 $\mathbf{b}-\hat{\mathbf{b}}\perp {\rm Col}A$, 所以 $A^T(\mathbf{b}-A\hat{\mathbf{x}})=\mathbf{0}\rightarrow A^TA\hat{\mathbf{x}}=A^T\mathbf{b}$ . 方程 $A\mathbf{x}=\mathbf{b}$ 的最小二乘解集和法方程 $A^TA\hat{\mathbf{x}}=A^T\mathbf{b}$ 的非空解集一致, 若 $A$ 列满秩则最小二乘解存在且唯一. 若不存在, [[伪逆]]提供了一个稳健的方法来求最小二乘解
- $A\hat{\mathbf{x}}=\hat{\mathbf{b}}$
- $\mathbf{b}-\hat{\mathbf{b}}\perp {\rm Col}A$
- $A^T(\mathbf{b}-A\hat{\mathbf{x}})=\mathbf{0}\rightarrow A^TA\hat{\mathbf{x}}=A^T\mathbf{b}$
- $\hat{\mathbf{x}}=(A^TA)^{-1}A^T\mathbf{b}$
- $\hat{\mathbf{x}}=A^\dagger\mathbf{b}$