Least Squares Fitting

I am pleased to provide copies of my computer subroutines LLSQF, LLSQFVL and NLLSSRR for performing linear or non-linear least-squares fits. These routines are very efficient, robust and accurate. Subroutine LLSQF is appropriate for linear least-squares (or a single cycle on a non-linear fit) cases in which the data set being treated is of modest size, so that calculating and storing the entire partial derivative array presents no problem. LLSQFVL is essentially identical to LLSQF except that the partial derivatives for each datum are generated and used as they are needed, one at a time, and there is no need to store the entire array. The latter is often more convenient when one is performing many-parameter fits to very large data sets. Supplementary documentation is provided by University of Waterloo Chemical Physics Research Report CP-628, a set of notes about linear and non-linear least-squares fitting which describes the use of subroutines LLSQF and LLSQFVL.

For most practical purposes, routines LLSQF and LLSQFVL have been superceded by a more general linear or non-linear fitting routine called NLLSSRR, which implements iterative convergence for non-linear fits internally, and automatically performs (if desired) the sequential rounding and refitting (SRR) procedure described in the paper "Uncertainty, Precision, Convergence and Rounding in Performing and Reporting Least-Squares Fits", by R.J. Le Roy [J.Mol.Spectrosc. 191, 223-231 (1998)]. This SRR method yields a final set of fitted parameters with minimum numbers of significant digits with no loss of accuracy. Note, however, that while there are detailed comments in the NLLSSRR code which describe its use, report CP-628 have not yet been updated to incorporate a description of NLLSSRR.

For most practical purposes, routines LLSQF and LLSQFVL have been superceded by a more general linear or non-linear fitting routine called NLLSSRR, which implements iterative convergence for non-linear fits internally, and automatically performs (if desired) the sequential rounding and refitting (SRR) procedure described in the paper "Uncertainty, Precision, Convergence and Rounding in Performing and Reporting Least-Squares Fits", by R.J. Le Roy [J.Mol.Spectrosc. 191, 223-231 (1998)]. This SRR method yields a final set of fitted parameters with minimum numbers of significant digits with no loss of accuracy. Note, however, that while there are detailed comments in the NLLSSRR code which describe its use, report CP-628 have not yet been updated to incorporate a description of NLLSSRR.

NLLSSRR Source Code
PDF Documentation