public class OLSSolverBySVD
extends Object
This class solves an over-determined system of linear equations in the
ordinary least square sense.
An over-determined system, represented by
\[
Ax = y
\]
has more rows than columns. That is, there are more equations than unknowns.
One important application is linear regression, where A is the
independent factors, y the dependent observations.
The solution \(\hat{x}\) minimizes:
\[
|Ax - y|_{2}
\]
That is, \(\hat{x}\) is the best approximation that
minimizes the sum of squared differences between the data values and their
corresponding modeled values.
The approach is called "linear" least squares since the solution depends
linearly on the data.
\[
\hat{x} = (A^{\mathsf T}A)^{-1}A^{\mathsf T}y,
\]
This implementation does not use the above formula to solve for \(\hat{x}\)
because of the numerical stability problem in computing
\(A^{\mathsf T}A\).
Instead, we use SVD decomposition, an orthogonal decomposition method that is
numerically stable.
SVD allows approximation by truncating small singular values.
- See Also: