NLFitLevenbergMarquardtFit(NLFitLMFunction, Double, Double, Double, CancellationToken, Int32) Method |
Minimizes the sum of squares of m nonlinear functions in n variables using the Levenberg-Marquardt algorithm.
Namespace: Altaxo.Calc.RegressionAssembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntaxpublic static void LevenbergMarquardtFit(
NLFitLMFunction fcn,
double[] xvec,
double[] fvec,
double tol,
CancellationToken cancellationToken,
ref int info
)
Parameters
- fcn NLFitLMFunction
- The user-supplied function that provides values to minimize.
- xvec Double
-
Array of length n containing the parameter vector. On input, it must contain an initial estimate of the solution.
On output, it contains the final estimate of the solution.
- fvec Double
- Output array of length m which receives the function values evaluated at the output xvec.
- tol Double
-
Nonnegative input variable. Termination occurs when the algorithm estimates either that the relative error in the sum of squares
is at most tol, or that the relative error between xvec and the solution is at most tol.
- cancellationToken CancellationToken
- Token to cancel the fit.
- info Int32
-
Info is an integer output variable. If the user has
terminated execution, info is set to the (negative)
value of iflag. See description of fcn. Otherwise,
info is set as follows:
info = 0 improper input parameters.
info = 1 algorithm estimates that the relative error
in the sum of squares is at most tol.
info = 2 algorithm estimates that the relative error
between x and the solution is at most tol.
info = 3 conditions for info = 1 and info = 2 both hold.
info = 4 fvec is orthogonal to the columns of the
Jacobian to machine precision.
info = 5 number of calls to fcn has reached or
exceeded 200*(n+1).
info = 6 tol is too small. No further reduction in
the sum of squares is possible.
info = 7 tol is too small. No further improvement in
the approximate solution x is possible.
Remarks
This is the easiest-to-use interface with the smallest number of arguments.
If you need more control over the minimization process and auxiliary storage allocation,
use one of the more general interfaces.
See Also