llsq


llsq, an Octave code which solves the linear least squares (LLS) problem. It finds the "best" straight line to match a set of data points. More precisely, it finds the quantities "a" and "b" defining the straight line y=a*x+b, which minimizes the root-mean-square (RMS) error to the data.

Licensing:

The computer code and data files described and made available on this web page are distributed under the MIT license

Languages:

llsq is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

llsq_test

fmincon_test, an Octave code which illustrates the use of fmincon, a function included in MATLAB's Optimization Toolbox, which seeks the minimizer of a scalar function of multiple variables, within a region specified by linear constraints and bounds.

gdls, an Octave code which uses gradient descent to solve a linear least squares (LLS) problem.

test_approx, an Octave code which defines test problems for approximation, provided as a set of (x,y) data.

test_lls, an Octave code which implements linear least squares (LLS) test problems of the form A*x=b.

Reference:

  1. David Kahaner, Cleve Moler, Steven Nash,
    Numerical Methods and Software,
    Prentice Hall, 1989,
    ISBN: 0-13-627258-4,
    LC: TA345.K34.

Source Code:


Last revised on 06 June 2023.