eLynx SDK v3.3.0
C++ image processing API reference
Static Public Member Functions

eLynx::Math::GaussNewton Class Reference

Non-linear iterative function fitter, implemented using Gauss-Newton method. More...

#include <GaussNewton.h>

List of all members.

Static Public Member Functions

static void FitParams (const IFunctionNL &iFunction, const IMatrix &iSamples, const IVector &iInitialGuess, IVector &oParams, double iEpsilon=1e-5, uint32 iMaxIterations=0)
 Fits specified function for the given set of samples, using initial parameters guess for the first iteration.

Detailed Description

Non-linear iterative function fitter, implemented using Gauss-Newton method.

The class solves the problem of fitting nonlinear function to given set of samples - in other words, it tries to find the values for function parameters, for which the sum of squares of differences between function and given set of samples is minimized. The function can be of one or more independent variables. The non-linearity of the function is in the meaning of parameters, not variables - function with linear parameters can be fitted with single-pass least squares method. The function has to implement IFunctionNL interface in order to be fitted. The samples are given using matrix, parameters using vector. As the method is iterative one, caller must supply initial guess for parameter values.


Member Function Documentation

static void eLynx::Math::GaussNewton::FitParams ( const IFunctionNL iFunction,
const IMatrix iSamples,
const IVector iInitialGuess,
IVector oParams,
double  iEpsilon = 1e-5,
uint32  iMaxIterations = 0 
) [static]

Fits specified function for the given set of samples, using initial parameters guess for the first iteration.

In general, it fits function of n-independent variables and m-parameters to the finite set of samples. Samples are specified as matrix with n+1 columns, one sample per row. Columns 0, 1, ... holds values for independent variables, last column contains values for dependent variable (function results). Initial parameters guess and resulting parameters values are given by vectors of size m.

Parameters:
iFunctionthe function to be fitted
iSamplesthe matrix of samples
iInitialGuessthe initial guess for parameters values
oParamsthe resulting parameters values (the best fit)
iEpsilonthe iteration threshold value - if the difference in the length of parameter vector between two iterations is less than this value, the iteration stops
iMaxIterationsif nonzero, the iteration will be stopped after specified number of iterations, even if threshold was not reached. Can be used to prevent infinite iteration problem.

The documentation for this class was generated from the following file:

Generated on Thu Dec 9 2010 by doxygen 1.7.2