next up previous contents
Next: freeze (and rfreeze) Up: Fit Commands Previous: error (and rerror)

fit: fit data

Find the best fit model parameters for the current data by minimizing the current statistic.

Syntax:           fit  <fit method parameters>

The arguments to fit depend on the fitting method currently in use. See the method command for details (and for the usage of the USE_NUMERICAL_DIFFERENTIATION option in the user’s startup Xspec.init file). Output from the fit command also depends on the fitting method currently in use.

Examples:

Using the Levenberg-Marquardt algorithm, the parameters accepted are the maximum <number of iterations> before the user is prompted, and the <critical delta>, which is the (absolute, not fractional) change in the statistic between iterations less than which the fit is deemed to have converged.  If <number of iterations> or <critical delta> is entered through the fit command, it also becomes the future default value for the currently loaded fit method (ie. Levenberg-Marquardt).

XSPEC12> fit

// Fit with the default number of iterations and critical delta

// chi-squared.

XSPEC12> fit 60

// Fit with 60 as the number of iterations.

XSPEC12> fit  50 1.e-3

// Fit with 1.e-3 as the critical delta.