MF_nonlinfit_... MD_nonlinfit_... ME_nonlinfit_...
MF_nonlinfitwW_... MD_nonlinfitwW_... ME_nonlinfitwW_...
Functionhelper functions for MF_nonlinfit and MF_nonlinfitwW
Syntax C/C++#include <MFstd.h>
void MF_nonlinfit_autoDeriv( fMatrix dZdAi, ui htZ, ui lenZ, fVector X, fVector Y, unsigned ipar, fVector A, MF_NONLINFITWORKSPACE *ws );
float MF_nonlinfit_getFOM( MF_NONLINFITWORKSPACE *ws );
void MF_nonlinfit_getBestValues( fVector ABest, MF_NONLINFITWORKSPACE *ws );
unsigned MF_nonlinfit_getTestRun( MF_NONLINFITWORKSPACE *ws );
unsigned MF_nonlinfit_getTestPar( MF_NONLINFITWORKSPACE *ws );
int MF_nonlinfit_getTestDir( MF_NONLINFITWORKSPACE *ws );
void MF_nonlinfit_stop( MF_NONLINFITWORKSPACE *ws );

  (identical syntax for the MF_nonlinfitwW_... functions)
C++ MatObj#include <OptiVec.h>
void matrix<T>::nonlinfit_getFOM( MF_NONLINFITWORKSPACE *ws );
void vector<T>::Mnonlinfit_getBestValues( MF_NONLINFITWORKSPACE *ws );
unsigned matrix<T>::nonlinfit_getTestPar( MF_NONLINFITWORKSPACE *ws );
unsigned matrix<T>::nonlinfit_getTestRun( MF_NONLINFITWORKSPACE *ws );
void matrix<T>::nonlinfit_stop( MF_NONLINFITWORKSPACE *ws );

  (identical syntax for the nonlinfitwW_... functions)
Pascal/Delphiuses MFnlfit;
procedure MF_nonlinfit_autoDeriv( dZdAi:fMatrix; htZ, lenZ:UIntSize; X, Y:fVector; ipar: UInt; A:fVector; ws: PMF_NONLINFITWORKSPACE );
function MF_nonlinfit_getFOM( ws: PMF_NONLINFITWORKSPACE ): Single;
procedure MF_nonlinfit_getBestValues( BestValues: fVector; ws: PMF_NONLINFITWORKSPACE );
function MF_nonlinfit_getTestRun( ws: PMF_NONLINFITWORKSPACE ): UInt;
function MF_nonlinfit_getTestPar( ws: PMF_NONLINFITWORKSPACE ): UInt;
function MF_nonlinfit_getTestDir( ws: PMF_NONLINFITWORKSPACE ): Integer;
procedure MF_nonlinfit_stop( ws: PMF_NONLINFITWORKSPACE );

  (identical syntax for the MF_nonlinfitwW_... functions)
DescriptionMF_nonlinfit_autoDeriv performs a numerical differentiation of a user-provided z=f(x,y) model function with respect to the parameter aipar of the model. This function can be called only from within a function passed as the argument "derivatives" to MF_nonlinfit. The model function that is differentiated by MF_nonlinfit_autoDeriv is the one passed in the same call to MF_nonlinfit (see that function for details!).

The following functions allow to monitor the progress of a nonlinear fitting operation. They can either be called from within the provided model function or, for multi-thread applications, from a second thread running in parallel to the thread containing the fitting function.
MF_nonlinfit_getFOM returns the best figure-of-merit (c2 or, for robust fits, |c|) obtained so far. If you call this function before MF_nonlinfit has had the chance to calculate c2, MF_nonlinfit_getFOM returns -1.0.

MF_nonlinfit_getBestValues stores the best parameters ai obtained so far into the user-supplied vector ABest.

MF_nonlinfit_getTestDir returns the test direction (+1 for upwards, -1 for downwards) during "breakout" attempts from possible local optima which would otherwise prevent the routine from finally reaching the global optimum (level-of-method greater than 3 specified by VF_setNonlinfitOptions).

MF_nonlinfit_getTestPar returns the index of the parameter currently under "breakout" investigation.

MF_nonlinfit_getTestRun returns the index of the current "breakout" test run. For each fitted parameter, one test run is performed. The order in which the parameters are checked is determined internally in such a way as to test the most sensitive parameters first.

MF_nonlinfit_stop makes MF_nonlinfit finish its current Levenberg-Marquardt or Downhill-Simplex cycle, update the output parameters and return. Thereby, long fitting sessions (especially tedious "break-out" attempts) may be broke off without the loss of any data.

See alsochapter 13

MatrixLib Table of Contents  OptiVec home