Class BoundedOneVariableFunctionFitter fits a parameterized one variable function to a set of points, where the functions parameters are constrained by upper and lower bounds.

Namespace:  CenterSpace.NMath.Analysis
Assembly:  NMath (in NMath.dll) Version: 5.1.0.0

Syntax

C#
public class BoundedOneVariableFunctionFitter<M> : OneVariableFunctionFitter<M>
where M : new(), IBoundedNonlinearLeastSqMinimizer
Visual Basic (Declaration)
Public Class BoundedOneVariableFunctionFitter(Of M As {New, IBoundedNonlinearLeastSqMinimizer}) _
	Inherits OneVariableFunctionFitter(Of M)
Visual C++
generic<typename M>
where M : gcnew(), IBoundedNonlinearLeastSqMinimizer
public ref class BoundedOneVariableFunctionFitter : public OneVariableFunctionFitter<M>

Type Parameters

M

[Missing <typeparam name="M"/> documentation for "T:CenterSpace.NMath.Analysis.BoundedOneVariableFunctionFitter`1"]

Remarks

In the space of the function parameters, begining at a specified starting point, finds a minimum (possibly local) in the sum of the squared residuals with respect to a set of data points. Uses nonlinear least squares minimization with solution bounds to compute the solution. You must supply at least as many data points to fit as your function has parameters.
For example, the following code fits a 4-parameter logistic function to a set of 10 data points, beginning at point (0.1, 0.1, 0.1, 0.1) in a constrained parameter space.
CopyC#
BoundedOneVariableFunctionFitter<TrustRegionMinimizer>; fitter = new BoundedOneVariableFunctionFitter<TrustRegionMinimizer>(AnalysisFunctions.FourParameterLogistic);

DoubleVector xValues = new DoubleVector(55, 64, 70, 76, 80, 90, 72, 65, 86, 75);
DoubleVector yValues = new DoubleVector(338, 328, 308, 225, 180, 142, 283, 325, 143, 250);
DoubleVector initialParameters = new DoubleVector("0.1 0.1 0.1 0.1");
DoubleVector parameterLowerBounds = new DoubleVector("-2.3, -4.5, -5.0, 0.0");
DoubleVector parameterUpperBounds = new DoubleVector("20.3, 14.5, 5.0, 10.0");
DoubleVector solution = fitter.Fit(xValues, yValues, initialParameters, parameterLowerBounds, parameterUpperBounds);
Note that problems can have multiple local minima. Trying different initial parameter points is recommended for better solutions.

Inheritance Hierarchy

System..::.Object
  CenterSpace.NMath.Analysis..::.OneVariableFunctionFitter<(Of <(M>)>)
    CenterSpace.NMath.Analysis..::.BoundedOneVariableFunctionFitter<(Of <(M>)>)

See Also