🔵 🔵 🔵


Primary

၊၊||၊|။

fit ⚬ˣˢᵖᵉᶜ|docu|1st|20251021175009-00-⌔

fit


fit

fit data

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

📊 ➺

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_CHAIN_RULE option in the user’s startup Xspec.init file). Output from the fit command also depends on the fitting method currently in use.

Using the Levenberg-Marquardt algorithm, the parameters accepted are the maximum before the user is prompted, the , which is the (absolute, not fractional) change in the statistic between iterations less than which the fit is deemed to have converged, and .

The provides an optional second stopping criterion, and it refers to the |beta|/N value reported during a Levenberg-Marquardt fit. This is the norm of the vector derivatives of the statistic with respect to the parameters divided by the number of parameters. At the best fit this should be zero, and so provides another measure of how well the fit is converging. is set to a negative value by default, which renders it inactive.

Including the string delay as an argument to fit turns on delayed gratification. It is turned off by nodelay. Delayed gratification modifies the way the damping parameter is set and has been shown in many cases to speed up convergence. The default is nodelay.

If , , , delay, or nodelay is entered through the fit command, it also becomes the future default value for the currently loaded fit method (ie. Levenberg-Marquardt).

Examples:

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.
XSPEC12> fit 50 1.e-3  20.
// Same fit, but will now use |beta|/N = 20.0 as another stopping
// criterion in addition to that of the critical delta. 
XSPEC12> fit delay
// Same fit, but will now use delayed gratification.

Printed 2026-06-28.

(echo:: @ )

Link to original

Secondary

• • •