next up previous contents index
Next: 9.24 newplot() Up: 9 Commands Previous: 9.22 macro()

9.23 minimize()

Description
Minimize an array in the least squares sense, by adjusting the values of the fitting variables. This gives a simple and flexible way to fit general data to a fairly simple models.
Input Program Variables
None.
Keywords/Values

Keyword Variable Default Description

1array
    residual to be minimized
x     x-array associated with array
uncertainty     array of uncertainties in residual
xmin     low-x value for fit range
xmax     high-x value for fit range
toler   1.e-8 fitting tolerance
restraint     scalar fitting restraint

     

Output Program Variables
chi_square, chi_reduced. For each variable XXX, the variable delta_XXX will be given it's estimated uncertainty.
Notes
The array named by x is optional, and is necessary only if xmin or xmax are given. The array given by uncertainty is optional as well.

Currently, only 1 restraint scalar can be added.

Examples

 
  Iff> guess (a  = 1, b = 0)
  Iff> my.resid = my.data - (a * my.x + b)
  Iff> minimize(my.resid)
See also
feffit()(Section 9.11), Chapter 8.


next up previous contents index
Next: 9.24 newplot() Up: 9 Commands Previous: 9.22 macro()
Matt Newville
2004-02-09