# LAWSON Least Squares Routines

LAWSON is a FORTRAN90 library which solves least squares problems.

The most common least squares problems considers an overdetermined M by N linear system A*X=B. A least squares solution X is sought which has the property that, although it generally is not a solution of the system, it is the best approximation to a solution, in the sense that it minimizes the L2 norm of the residual R=A*X-B.

In some cases, a unique solution to the system A*X=B will exist, and in that case the least squares solution will coincide with what is ordinarily meant by a solution.

In underdetermined cases, where multiple solutions exist, the least squares solution is usually taken to be that solution X which has minimum L2 norm, that is, which minimizes ||X||.

### Languages:

LAWSON is available in a FORTRAN90 version.

### Related Data and Programs:

BRENT, a FORTRAN90 library which contains Richard Brent's routines for finding the zero, local minimizer, or global minimizer of a scalar function of a scalar argument, without the use of derivative information.

BVLS, a FORTRAN90 library which applies least squares methods to solve a linear system for which lower and upper constraints may have been placed on every variable.

DQED, a FORTRAN90 library which solves constrained least squares problems.

ENTRUST, a MATLAB program which solves problems in scalar optimization or nonlinear least squares.

MINPACK, a FORTRAN90 library which solves systems of nonlinear equations, or the least squares minimization of the residual of a set of linear or nonlinear equations.

NL2SOL, a FORTRAN90 library which implements an adaptive nonlinear least-squares algorithm.

QR_SOLVE, a FORTRAN90 library which computes the least squares solution of a linear system A*x=b.

PRAXIS, a FORTRAN90 library which minimizes a scalar function of several variables.

TEST_LS, a FORTRAN90 library which implements linear least squares test problems of the form A*x=b.

TEST_OPT, a FORTRAN90 library which defines test problems requiring the minimization of a scalar function of several variables.

TOMS611, a FORTRAN90 library which seeks the minimizer of a scalar functional of multiple variables.

### Reference:

1. Gene Golub, Christian Reinsch,
Singular Value Decomposition and Least Squares Solutions,
Numerische Mathematik,
Volume 14, Number 5, April 1970, pages 403-420.
2. Charles Lawson, Richard Hanson,
Solving Least Squares Problems,
SIAM, 1995,
ISBN: 0898713560,
LC: QA275.L38.

### List of Routines:

• BNDACC accumulates information for a banded least squares problem.
• BNDSOL solves a banded least squares problem accumulated by BNDACC.
• DIFF is used in tests that depend on machine precision.
• G1 computes an orthogonal rotation matrix.
• G2 applies a rotation matrix to a vector (X,Y).
• GEN generates numbers for construction of test cases.
• H12 constructs or applies a Householder transformation.
• HFTI: Householder forward triangulation with column interchanges.
• LDP implements least distance programming
• MFEOUT labeled matrix output for use with singular value analysis.
• NNLS implements the nonnegative least squares algorithm.
• QRBD uses the QR algorithm for the singular values of a bidiagonal matrix.
• SVA carries out a singular value analysis.
• SVDRS: singular value decomposition also treating right side vector.

You can go up one level to the FORTRAN90 source codes.

Last revised on 21 October 2008.