Linear least squares
Library · Source module
Linear least squares
NLAlib.IsLeastSquaresSolution A b x says that \mathbf{x} minimises \|\mathbf{b} - \mathbf{A}\mathbf{x}\| over all vectors. It is the interface for "\mathbf{x} solves the least-squares problem": a theorem about a solver concludes it, and a theorem about a solution takes it. The minimisers are characterised by the normal equations and by \mathbf{A}\mathbf{x} being the projection of \mathbf{b} onto the column space; the pseudoinverse gives the one of smallest norm, and the residual is (\mathbf{I} - \mathbf{P}_{\mathbf{A}})\mathbf{b}, with \mathbf{P}_{\mathbf{A}} the orthogonal projector onto the range of \mathbf{A} (rangeProjector).
Sketch-and-solve replaces the problem by the one sketched by \mathbf{S}; its solution NLAlib.sketchAndSolve A S B, written \mathsf{sketchAndSolve}(\mathbf{A}, \mathbf{S}, \mathbf{B}), has fitted values the oblique projection \mathbf{\Pi}_{\mathbf{A},\mathbf{S}}\mathbf{B}, and when \mathbf{S} keeps the rank of \mathbf{A} it is the exact minimum-norm solution plus the sketched solution for the optimal residual. The solution does not change when the sketch is multiplied by a nonzero scalar, so the normalisations of Gaussian and Haar sketches do not matter for it.
Main definitions
* NLAlib.IsLeastSquaresSolution: \mathbf{x} minimises \|\mathbf{b} - \mathbf{A}\mathbf{x}\|. * NLAlib.sketchAndSolve: the sketch-and-solve solution.
Main results
* NLAlib.isLeastSquaresSolution_iff_normal_equations: the normal equations. * NLAlib.isLeastSquaresSolution_iff_mulVec_eq_rangeProjector_mulVec: \mathbf{A}\mathbf{x} = \mathbf{P}_{\mathbf{A}}\mathbf{b}. * NLAlib.isLeastSquaresSolution_pinv_mulVec: \mathbf{A}^{+}\mathbf{b} is a solution. * NLAlib.IsLeastSquaresSolution.norm_pinv_mulVec_le: it is the solution of smallest norm. * NLAlib.existsUnique_isLeastSquaresSolution_iff: uniqueness exactly for full column rank. * NLAlib.mul_sketchAndSolve, NLAlib.sketchAndSolve_eq_pinv_mul_add, NLAlib.HasOrthonormalCols.sketchAndSolve_eq_add: sketch-and-solve, its fitted values and its error decomposition. * NLAlib.sketchAndSolve_smul_sketch: rescaling the sketch does not change the solution.
Declarations
- NLAlib.HasOrthonormalCols.isLeastSquaresSolution_mul_iff
- NLAlib.HasOrthonormalCols.sketchAndSolve_eq_add
- NLAlib.IsLeastSquaresSolution
- NLAlib.IsLeastSquaresSolution.eq_pinv_mulVec_of_norm_le
- NLAlib.IsLeastSquaresSolution.mulVec_eq
- NLAlib.IsLeastSquaresSolution.mulVec_eq_rangeProjector_mulVec
- NLAlib.IsLeastSquaresSolution.norm_pinv_mulVec_le
- NLAlib.IsLeastSquaresSolution.norm_sub_mulVec_eq
- NLAlib.IsLeastSquaresSolution.norm_sub_mulVec_sq
- NLAlib.IsLeastSquaresSolution.norm_sub_mulVec_sq_eq_add
- NLAlib.IsLeastSquaresSolution.pinv_mulVec_mulVec
- NLAlib.IsLeastSquaresSolution.sub_mulVec_eq
- NLAlib.existsUnique_isLeastSquaresSolution_iff
- NLAlib.exists_isLeastSquaresSolution
- NLAlib.isLeastSquaresSolution_iff
- NLAlib.isLeastSquaresSolution_iff_conjTranspose_mulVec_sub_eq_zero
- NLAlib.isLeastSquaresSolution_iff_eq_pinv_mulVec
- NLAlib.isLeastSquaresSolution_iff_exists
- NLAlib.isLeastSquaresSolution_iff_isMinOn
- NLAlib.isLeastSquaresSolution_iff_mulVec_eq_rangeProjector_mulVec
- NLAlib.isLeastSquaresSolution_iff_normal_equations
- NLAlib.isLeastSquaresSolution_of_mulVec_eq
- NLAlib.isLeastSquaresSolution_pinv_mulVec
- NLAlib.mul_sketchAndSolve
- NLAlib.norm_sub_mulVec_sq_eq_add_norm_mulVec_sub_pinv_sq
- NLAlib.sketchAndSolve
- NLAlib.sketchAndSolve_eq_pinv_mul_add
- NLAlib.sketchAndSolve_smul_sketch