Represents an algorithm that fits a nonlinear function to data.
SystemObject Extreme.Mathematics.CurvesNonlinearCurveFitterT
Namespace:
Extreme.Mathematics.Curves
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public class NonlinearCurveFitter<T>
Public Class NonlinearCurveFitter(Of T)
generic<typename T>
public ref class NonlinearCurveFitter
type NonlinearCurveFitter<'T> = class end
Type Parameters
- T
- The domain of the nonlinear function.
The NonlinearCurveFitterT type exposes the following members.
Top
| Name | Description |
---|
 | Algorithm |
Gets or sets the nonlinear least squares algorithm that is to be used
in the calculations.
|
 | BestFitParameters |
Gets the curve parameters corresponding to the best fit.
|
 | Function |
Gets or sets the function to be fitted.
|
 | FunctionGradient |
Gets or sets the gradient of the function to be fitted.
|
 | InitialGuess |
Gets or sets the initial value for the iteration.
|
 | LowerBounds |
Gets or sets the vector of lower bounds of the curve parameters.
|
 | Optimizer |
Gets the optimizer used to calculate the nonlinear least-squares solution.
|
 | Residuals |
Gets the residuals for the observations.
|
 | ScaleVector |
Gets or sets the vector used to scale the curve parameters.
|
 | StandardError |
Gets the standard error of the curve fit.
|
 | UpperBounds |
Gets or sets the vector of upper bounds of the curve parameters.
|
 | WeightFunction |
Gets or sets the weight function.
|
 | WeightVector |
Gets or sets the weight vector.
|
 | XValues |
Gets or sets the vector of x-values.
|
 | YValues |
Gets or sets the vector of y-values.
|
Top
Top
Use the NonlinearCurveFitterT class to fit data
to a nonlinear function by the method of least squares.
The function's domain can be of any type, so it is possible to fit
surfaces or arbitrary data.
The data is supplied as IListT objects
through the XValues and a Vector for the YValues
properties.
The Fit method performs the actual curve fit.
This method returns a delegate represents the function that best fits the supplied data.
The Optimizer property returns the MultidimensionalOptimizer
object that was used to find the least squares solution.
To verify that the algorithm terminated normally, you can inspect the Optimizer's
Status property, which is of type AlgorithmStatus.
A value of Normal indicates that the algorithm terminated normally.
However, it is still possible that the algorithm didn't converge to the actual best fit.
A visual inspection is always recommended.
The parameters of the fitted curve can be retrieved through the BestFitParameters
property. The standard deviations associated with each parameter are available through the
GetStandardDeviations method.
By default, the observations are unweighted. You can supply a
weighting method in two ways. You can set the WeightFunction
property to a function of two variables delegate that computes the weight
for each observation. The WeightFunctions class provides predefined
delegates for the most common weight functions.
Alternatively, you can set the individual weights by setting the WeightVector
property to a Vector that contains the weight for each individual observation.
Reference