Curve fitting with the Levenberg-Marquardt algorithm
Curve fitting
=============
Given some points in R×R and a parametered function f_p : R → R,
find an optimal set of parameters so that f "fits" the points.
E.g. given some points (x_i, y_i) and the model function f(p1, p2)(x) = p1 * x² + p2,
find p=[p1, p2] so that the least squares error Σ (f(p)(x_i) - y_i)² is minimal.
The only algorithm available in this library is Levenberg-Marquardt.
It is suitable for non-linear least-square approximation.
See
Other algorithms may be implemented later.
For examples and benchmarks :
Usage
-----
In a JS web code, load build/web/curve-fitting.js.
This file is in each release and in the dist branch.
You can build the latest version yourself from the master branch.
In a JS Node code, require build/node/curve-fitting.js.
In both cases, an alternative is to import the module @mytskine/curve-fitting.
In a TypeScript code, you can import src/main.ts.
The parameters and the result are documented alongside the code.
The default values should cover most needs.
Web (declares a global variable CurveFitting)
```
Module (web)
`