The basic fit command is called fit. This command performs a minimization
using the Levenberg-Marquardt algorithm. fit can take two
arguments, those being 1) the number of iterations to be performed before the
user is asked whether to continue; and 2) the change in fit statistic
that defines convergence. The fit statistics available within XSPEC are the
and C statistics: the statistic command specifies which
one is to be used. The bayes command sets up Bayesian inference.
Other fit-minimization algorithms are available, and
can be selected using the method command. A genetic algorithm is
included and its operations controlled by the genetic command.
For non-background-subtracted data the goodness command does a Monte
Carlo calculation of the goodness-of-fit. The weighting algorithm
used to calculate
can be altered by the weight command. A
systematic model uncertainty can be included using the the
systematic command. If the CERN library is linked in then the
command improve can be used to try to check whether the minimum
found is local or global.
The error or uncertain command calculates error bounds for one interesting parameter for the specified parameters and confidence levels. To produce multi-dimensional errors the steppar command is used to generate a fit-statistic grid. Two-dimensional grids may be expressed as contour plots (using plot contour). The model normalization can be set using the renorm command. The normalization of the correction file background can be set with cornorm, and can be set to minimize the fit statistic with recornorm. The gain of the response matrix can be adjusted using the gain command, which includes an option to fit for the gain. ftest provides calculation of F-test values and probabilities.