Click or drag to resize

BoundedMultiVariableFunctionFitterMFit(DoubleMatrix, DoubleVector, DoubleVector, DoubleVector, DoubleVector) Method

Fits a function to the specified points where the resulting function parameters satisfy the given inequality constriants
C#
parameterLowerBounds[i] < parameters[i] < parameterUpperBounds[i]
for each i.

Namespace: CenterSpace.NMath.Core
Assembly: NMath (in NMath.dll) Version: 7.4
Syntax
public DoubleVector Fit(
	DoubleMatrix xValues,
	DoubleVector yValues,
	DoubleVector initialParameters,
	DoubleVector parameterLowerBounds,
	DoubleVector parameterUpperBounds
)

Parameters

xValues  DoubleMatrix
parameters values of the points to fit. Each row in the matrix is an x-value of the points to fit.
yValues  DoubleVector
yValues values of the points to fit.
initialParameters  DoubleVector
The starting function parameters.
parameterLowerBounds  DoubleVector
The lower bounds for the parameters. parameterLowerBounds[i] < parameters[i]
parameterUpperBounds  DoubleVector
The upper bounds for the parameters. parameters[i] < parameterUpperBounds[i]

Return Value

DoubleVector
The parameters of the function which satisfy the constraints and minimize the sum of the squared residuals.
Exceptions
ExceptionCondition
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
In the space of the function parameters, begining at the specified starting point (initialParameters), finds a set of parameters satisfying the given inequality constraints and minimize sum of the squared residuals, where residuals[i] = ( yValues[i] - f( currentParameters, xValues[i] )^2. You must supply at least as many points to fit as your function has parameters.
Note that problems can have multiple local minima. Trying different initial points is recommended for better solutions. In addition, the initial parameters should satisfy the given inequality constraints.
See Also