This directory contains utility for implementing generic Reqursive Least Squares (RLS) algorithm. The example shows how one can use the utility to estamate the parameters of a simple linear discrete time system.
The module LSQ is for unconstrained linear least-squares fitting. It is
based upon Applied Statistics algorithm AS 274 (see comments at the start
of the module). A planar-rotation algorithm is used to update the QR-
factorization. This makes it suitable for updating regressions as more
data become available. The module contains a test for singularities which
is simpler and quicker than calculating the singular-value decomposition.
An important feature of the algorithm is that it does not square the condition
number. The matrix X X is not formed. Hence it is suitable for ill-
conditioned problems, such as fitting polynomials.
By taking advantage of the MODULE facility, it has been possible to remove
many of the arguments to routines. Apart from the new function VARPRD,
and a back-substitution routine BKSUB2 which it calls, the routines behave
as in AS 274.
多項式曲線擬合 任意介數(shù) Purpose - least-squares curve fit of arbitrary order
working in C++ Builder 2007 as a template class,
using vector<FloatType> parameters.
Added a method to handle some EMathError exceptions.
If do NOT want to use this just call PolyFit2 directly.
usage: Call PolyFit by something like this.
CPolyFit<double> PolyFitObj
double correlation_coefficiant = PolyFitObj.PolyFit(X, Y, A)
where X and Y are vectors of doubles which must have the same size and
A is a vector of doubles which must be the same size as the number of
coefficients required.
returns: The correlation coefficient or -1 on failure.
produces: A vector (A) which holds the coefficients.
C/C++ implementation of the Levenberg-Marquardt non-linear
least squares algorithm. levmar includes double and single precision LM versions, both
with analytic and finite difference approximated jacobians