Click or drag to resize

NLFitLevenbergMarquardtFit(NLFitLMFunction, Double, Double, Double, Int32, Int32, Double, Double, Int32, Double, Double, Double, Double, Double, CancellationToken) Method

The purpose of LevenbergMarquardtFit is to minimize the sum of the squares of m nonlinear functions in n variables by a modification of the Levenberg-Marquardt algorithm. This is done by using the more general least-squares solver below. The user must provide a subroutine which calculates the functions. The Jacobian is then calculated by a forward-difference approximation.

Namespace: Altaxo.Calc.Regression
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static void LevenbergMarquardtFit(
	NLFitLMFunction fcn,
	double[] xvec,
	double[] fvec,
	double tol,
	ref int info,
	int[] iwa,
	double[] diag,
	double[] fjac,
	int[] ipvt,
	double[] qtf,
	double[] wa1,
	double[] wa2,
	double[] wa3,
	double[] wa4,
	CancellationToken cancellationToken
)

Parameters

fcn  NLFitLMFunction
The user supplied function which provides the values to minimize.
xvec  Double
Array of length n containing the parameter vector. On input x must contain an initial estimate of the solution vector. On output x contains the final estimate of the solution vector.
fvec  Double
Output array of length m which contains the functions evaluated at the output x.
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 x and the solution is at most tol.
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.
iwa  Int32
Integer working array of length n.
diag  Double

[Missing <param name="diag"/> documentation for "M:Altaxo.Calc.Regression.NLFit.LevenbergMarquardtFit(Altaxo.Calc.Regression.NLFit.LMFunction,System.Double[],System.Double[],System.Double,System.Int32@,System.Int32[],System.Double[],System.Double[],System.Int32[],System.Double[],System.Double[],System.Double[],System.Double[],System.Double[],System.Threading.CancellationToken)"]

fjac  Double

[Missing <param name="fjac"/> documentation for "M:Altaxo.Calc.Regression.NLFit.LevenbergMarquardtFit(Altaxo.Calc.Regression.NLFit.LMFunction,System.Double[],System.Double[],System.Double,System.Int32@,System.Int32[],System.Double[],System.Double[],System.Int32[],System.Double[],System.Double[],System.Double[],System.Double[],System.Double[],System.Threading.CancellationToken)"]

ipvt  Int32

[Missing <param name="ipvt"/> documentation for "M:Altaxo.Calc.Regression.NLFit.LevenbergMarquardtFit(Altaxo.Calc.Regression.NLFit.LMFunction,System.Double[],System.Double[],System.Double,System.Int32@,System.Int32[],System.Double[],System.Double[],System.Int32[],System.Double[],System.Double[],System.Double[],System.Double[],System.Double[],System.Threading.CancellationToken)"]

qtf  Double

[Missing <param name="qtf"/> documentation for "M:Altaxo.Calc.Regression.NLFit.LevenbergMarquardtFit(Altaxo.Calc.Regression.NLFit.LMFunction,System.Double[],System.Double[],System.Double,System.Int32@,System.Int32[],System.Double[],System.Double[],System.Int32[],System.Double[],System.Double[],System.Double[],System.Double[],System.Double[],System.Threading.CancellationToken)"]

wa1  Double

[Missing <param name="wa1"/> documentation for "M:Altaxo.Calc.Regression.NLFit.LevenbergMarquardtFit(Altaxo.Calc.Regression.NLFit.LMFunction,System.Double[],System.Double[],System.Double,System.Int32@,System.Int32[],System.Double[],System.Double[],System.Int32[],System.Double[],System.Double[],System.Double[],System.Double[],System.Double[],System.Threading.CancellationToken)"]

wa2  Double

[Missing <param name="wa2"/> documentation for "M:Altaxo.Calc.Regression.NLFit.LevenbergMarquardtFit(Altaxo.Calc.Regression.NLFit.LMFunction,System.Double[],System.Double[],System.Double,System.Int32@,System.Int32[],System.Double[],System.Double[],System.Int32[],System.Double[],System.Double[],System.Double[],System.Double[],System.Double[],System.Threading.CancellationToken)"]

wa3  Double

[Missing <param name="wa3"/> documentation for "M:Altaxo.Calc.Regression.NLFit.LevenbergMarquardtFit(Altaxo.Calc.Regression.NLFit.LMFunction,System.Double[],System.Double[],System.Double,System.Int32@,System.Int32[],System.Double[],System.Double[],System.Int32[],System.Double[],System.Double[],System.Double[],System.Double[],System.Double[],System.Threading.CancellationToken)"]

wa4  Double

[Missing <param name="wa4"/> documentation for "M:Altaxo.Calc.Regression.NLFit.LevenbergMarquardtFit(Altaxo.Calc.Regression.NLFit.LMFunction,System.Double[],System.Double[],System.Double,System.Int32@,System.Int32[],System.Double[],System.Double[],System.Int32[],System.Double[],System.Double[],System.Double[],System.Double[],System.Double[],System.Threading.CancellationToken)"]

cancellationToken  CancellationToken
Token to cancel the fit.
Remarks
This is the most easy-to-use interface with the smallest number of arguments. If you need more control over the minimization process and auxilliary storage allocation you should use one of the interfaces described below.
See Also