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 :
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 :
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 :
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.
Note that in this case there is no analytic formula that can be used to set the model normalization.