Next: Adding models to XSPEC Up: Fitting with few counts/bin Previous: Theory

Subsections

# Practice

## No background

XSPEC uses a variant of Marquardt's algorithm described in §11.5 of Data Reduction and Error Analysis for the Physical Sciences" by Bevington. (The reader is advised that this description is designed to be read in conjunction with Bevington.) The algorithm turns on finding a matrix and a vector such that the equation :

gives sensible values of the change in parameters, , for the fitting function. Bevington §11.4 gives the derivation of and and shows that is parallel to the gradient of .

Now the C statistic has a gradient with respect to the parameters of the fitting function of :

So, following Bevington, expand y(xi) about y0 :

substitute into C and minimize with respect to the changes in the parameters :

so to first order in the parameter changes :

or :

where :

These and then are substituted for those used in the case and the algorithm works as required. Note that is to first order in partial derivatives in y, evaluated at y0.

There is one further difference in XSPEC between the and likelihood methods, which is caused by the fact that XSPEC uses an analytic formula for setting the model normalisation. In the case, this means multiplying the current model by :

where is the error on yi. In the likelihood case the corresponding factor is :

## With background

An analogous argument to the above can be followed through for the Wstatistic. We need the partial derivatives of W which are evaluated as follows.

where

Note that in this case there is no analytic formula that can be used to set the model normalization.

Next: Adding models to XSPEC Up: Fitting with few counts/bin Previous: Theory
Ben Dorman
2003-11-28