Version 1.0.0

Code Download

  • Single
  • Double

MA44 Over-determined linear system: least-squares solution

To solve an equality-constrained linear least squares problem. Given an over-determined system of m linear equations in n unknowns,

j=1na ijxj = bi, i = 1,2,...m, m n 1,

it calculates the solution vector x which satisfies the first m1 equations (0 m1 n) and minimizes the sum of squares of residuals

S(x) = i=1mr i2,

where

ri = j=1na ijxj bi, i = 1,2,...,m.

The matrix A = aij must have rank n, that is its columns must be linearly independent. Also the first m1 rows of A must be linearly independent.

There is a re-entry facility which allows further systems having the same left-hand sides to be solved economically.

There is an entry to obtain solution standard deviations and the variance-covariance matrix. These are calculated on the assumption that the first m1 equations are exact and that the remaining equations have errors which are independent random variables with the same variance.

The automatic printing of results and the calculation of equation residuals are options.

The subroutine can be used to solve the general linear least squares data fitting problem with or without equality side conditions.