Contents Previous Next Subchapters

Singular Linear Least Squares
Syntax linlsq(Abbound)
See Also nlsq , linlsqb

Returns a vector x, that solves the problem
     minimize | A x - b |  with respect to x

The matrix A is real, double-precision, or complex, b is a column vector with the same type and row dimension as A, and bound is a scalar with the same type as A such that absolute singular values of the matrix A that are less than bound are replaced by 0 before solving the minimization problem. If A is not complex, bound must have the same type as A. If A is complex, bound must be double-precision. The returned vector, x, has the same type as A.

If more than one solution exists, the solution of minimum norm is returned (i.e., the value of x that minimizes |x| over the set of solutions).

The operation "\" uses a QR factorization to solve similar problems. If the rank of A is less than both its row and column dimension, the "\" operator will generate an error if you compute A \ b. The linlsq function can solve such problems.

     A   = {1., 1.}
     b   = {1., 2.}
     eps = 1e-7 
     linlsq(A, b, eps)