|  | OneVariableFunctionFitterMFit(DoubleVector, DoubleVector, DoubleVector) Method | 
            Fits a function to the specified points.
            
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
 Syntax
Syntaxpublic DoubleVector Fit(
	DoubleVector xValues,
	DoubleVector yValues,
	DoubleVector initialParameters
)
Public Function Fit ( 
	xValues As DoubleVector,
	yValues As DoubleVector,
	initialParameters As DoubleVector
) As DoubleVector
public:
DoubleVector^ Fit(
	DoubleVector^ xValues, 
	DoubleVector^ yValues, 
	DoubleVector^ initialParameters
)
member Fit : 
        xValues : DoubleVector * 
        yValues : DoubleVector * 
        initialParameters : DoubleVector -> DoubleVector Parameters
- xValues  DoubleVector
- parameters values of the points to fit.
- yValues  DoubleVector
- yValues values of the points to fit.
- initialParameters  DoubleVector
- The starting function parameters.
Return Value
DoubleVectorThe parameters of the function at the minimum.
 Exceptions
Exceptions| Exception | Condition | 
|---|
| InvalidArgumentException | Thrown if the vectors of parameters and yValues values have different lengths,
            or if the number of points is not greater than or equal to the number of function parameters. | 
 Remarks
Remarks
            In the space of the function parameters, begining at the specified starting point (initialParameters),
            finds a minimum (possibly local) with respect to the sum of the squared residuals, where
            residuals[i] = ( yValues[i] - f( currentParameters, xValues[i] )^2. 
            
            Note that problems can have multiple local minima. Trying different initial points is recommended for
            better solutions. 
            
 See Also
See Also