Module gwy :: Class NLFitPreset
[hide private]
[frames] | no frames]

Class NLFitPreset

source code

Instance Methods [hide private]
 
UNIMPLEMENTED_get_value(x, params, fres)
Calculates preset function value in a single point with given parameters.
source code
 
get_formula()
Gets function formula of preset (with Pango markup).
source code
 
get_nparams()
Return the number of parameters of preset.
source code
 
get_param_name(param)
Gets the name of a fitting parameter of a fitter preset.
source code
 
get_param_units(param, siunit_x, siunit_y)
Derives the SI unit of a fitting parameter from the units of abscissa and ordinate.
source code
 
UNIMPLEMENTED_guess(n_dat, x, y, params, fres)
Performs initial parameter estimate for a NL fitter.
source code
 
UNIMPLEMENTED_fit(fitter, n_dat, x, y, params, err, fixed_param)
Performs a nonlinear fit with a preset.
source code
Method Details [hide private]

UNIMPLEMENTED_get_value(x, params, fres)

source code 

Calculates preset function value in a single point with given parameters.

Parameters:
  • preset - A NL fitter function preset.
  • params - Preset parameter values. (const-gdouble*)
  • fres - Set to True if succeeds, False on failure. (gboolean*)
Returns:
The function value.

get_formula()

source code 

Gets function formula of preset (with Pango markup).

Returns:
The preset function formula.

get_nparams()

source code 

Return the number of parameters of preset.

Returns:
The number of function parameters.

get_param_name(param)

source code 

Gets the name of a fitting parameter of a fitter preset.

The name may contain Pango markup.

Parameters:
  • param - A parameter number. (int)
Returns:
The name of parameter @param.

get_param_units(param, siunit_x, siunit_y)

source code 

Derives the SI unit of a fitting parameter from the units of abscissa and ordinate.

Since: 2.5

Parameters:
  • param - A parameter number. (int)
  • siunit_x - SI unit of abscissa. (SIUnit)
  • siunit_y - SI unit of ordinate. (SIUnit)
Returns:
A newly created SIUnit with the units of the parameter @param. If the units of @param are not representable as SIUnit, the result is unitless (i.e. it will be presented as a mere number).

UNIMPLEMENTED_guess(n_dat, x, y, params, fres)

source code 

Performs initial parameter estimate for a NL fitter.

The initial estimate method depends on the function used. There is no absolute guarantee of quality, however if the data points approximately match the fitted function the fit will typically converge from the returned estimate.

The parameters are filled also on failure, though just with some neutral values that should not give raise to NaNs and infinities.

Parameters:
  • n_dat - The number of data points (number of items in x and y). (int)
  • x - Abscissa points. (const-gdouble*)
  • y - Ordinate points. (const-gdouble*)
  • params - The array to fill with estimated parameter values. It has to be at least gwy_nlfit_preset_get_nparams() long. (gdouble*)
  • fres - Set to True if succeeds, False on failure. (gboolean*)

UNIMPLEMENTED_fit(fitter, n_dat, x, y, params, err, fixed_param)

source code 

Performs a nonlinear fit with a preset.

See gwy_math_nlfit_fit_full() for details.

Parameters:
  • fitter - A Marquardt-Levenberg nonlinear fitter already initialized for preset's function, or NULL. (NLFitter*)
  • n_dat - The number of data points (number of items in x and y). (int)
  • x - Abscissa points. (const-gdouble*)
  • y - Ordinate points. (const-gdouble*)
  • params - Initial parameter estimate (the number of parameters depends on the fitted preset and it can be obtained with gwy_nlfit_preset_get_nparams()). (gdouble*)
  • err - Array to store parameter errros to, may be NULL. (gdouble*)
  • fixed_param - Which parameters should be treated as fixed (set corresponding element to True for them). May be NULL if all parameters are variable. (const-gboolean*)
Returns:
Either fitter itself, or a newly created fitter if it was NULL.