genfit(vx,vy,vg,F) Returns a vector containing the parameters
that make a function f of x
and n parameters u1...un
best approximate the data in vx and vy.
The genfit function employs an optimized version of the Levenberg-Marquardt
method for minimization by default. While frequently faster and less sensitive
to poor guess values, this implementation may fail to converge well on problems
with many local minima, such as rational functions. It is also more sensitive
to incorrect derivative vectors. The optimized method allows you to solve using
numerical approximations for the parameter derivatives. To change methods, right-click
on the genfit function and select the desired method from the menu.
Arguments:
vx and vy are vectors of real data
values of the same length, corresponding to the x
and y-values in the data set. There must be at least
as many data points as parameters.
vg is an n-element vector of
guess values for the parameters, or, if n = 1, vg
is a scalar.
F(x,u) is a fitting function f(x,<parameter
list>), or an n+1 vector of functions
containing the fitting function f and the partial
derivatives of f with respect to the n
parameters. x is the independent variable,
and u is either a vector of parameters or individual
parameter names. For example
f(x,b):=b0·xb1
and f(x,A,c):=A·xc
are both valid representations for a fitting function.
n is a positive integer. In the case of non-vectorized
parameters, there is a limit of 9 individual names.
Notes:
The name of the vector of functions is supplied without its arguments to
genfit.
If you are using just the fitting function and allowing genfit to calculate
the parameter partial derivatives numerically, you must use the Optimized
Levenberg-Marquardt option.
If genfit has trouble converging, you may wish to try the alternative
Levenberg-Marquardt method, other guess values, or scaling your data so that all parameters
are of a similar order of magnitude. As with all numerical solution techniques,
nonlinear problems are highly sensitive to guess values. You may wish to try
plotting your fitting function with the guess values to refine them before
using genfit. Further, the Optimized Levenberg-Marquardt method is more sensitive to
errors in the supplied algebraic derivatives. If this method is failing, you
should check the derivative expressions.
All older-version worksheets in Mathcad default to the non-optimized
Levenberg-Marquardt version to maintain consistency with previous results.
To further analyze your data, you may wish to apply other statistics
functions for data analysis. To apply constraints to the parameter solutions,
you can use Minerr in a Solve Block.