next up [*] [*]
Next: Helpful Hints Up: Spectral Fitting and XSPEC Previous: Introduction


The XSPEC implementation

To summarize the preceding section, the main components of spectral fitting are as follows:

The observed spectrum (C(I))
The instrumental response (R(I,E))
A model spectrum (f(E))

These components are used in the following manner:

A parameterized model is created that one feels represents the actual spectrum of the source.
One then gives values to the model parameters.
Based on the parameter values given, one predicts the count spectrum that would be detected by the spectrometer in a given channel for such a model.
Then, one compares the predicted spectrum to the spectrum actually obtained by the instrument.
The values of the parameters of the model are manipulated until one finds the best fit between the theoretical model and the observed data.
One then calculates the ``goodness" of the fit to determine how well the model explains the observed data, and calculates the confidence intervals for the model's parameters.

This section describes how XSPEC performs these tasks.

C(I): The Observed Spectrum

To obtain the observed spectrum (C(I)), for a given observation, XSPEC uses two files: the data file, and the background file (for FITS file format see Arnaud, George & Tennant 19922.2). The data file tells XSPEC how many total photon counts were detected by the instrument in a given channel. XSPEC then uses the background file to derive a background-subtracted C(I) in units of counts per second. The background is scaled to the data by the ratio of the BACKSCAL values in the data and background files. It also is scaled for exposure times (EXPOSURE keyword) and AREASCAL values. The background-subtracted count rate is given by :

C(I) = D(I)/aD(I)/tD - (bD(I)/bB(I)) B(I)/aB(I)/tB

where D(I) and B(I) are the counts in the data and background files; tD and tB are the exposure times in the data and background files; bD(I) and bB(I) are the BACKSCAL values from the data and background files; and aD(I) and aB(I) are the AREASCAL values from the data and background files

When this is done XSPEC has an observed spectrum to which the model spectrum can be fit.

R(I,E): The Instrumental Response

Before XSPEC can take a given set of parameter values and predict the spectrum that would be detected by a given instrument, XSPEC must know the specific characteristics of the instrument. This information is known as the detector response. The response (R(I,E)), if you recall, is proportional to the probability that an incoming photon of energy E will be detected in channel I. As such, the response is a continuous function of E. This continuous function is converted to a discrete function by the creator of a response matrix who defines the energy ranges (EJ) such that:

\begin{displaymath}R_D (I,J) = \int_{E_{J-1}}^{E_J} R(I, E) dE / (E_J - E_{J-1})\end{displaymath}

XSPEC reads both the energy ranges, EJ, and the response matrix (RD(I,J)) from a response file (for FITS file format see George et al 19922.3) in a compressed format that only stores non-zero elements. XSPEC also includes an option to use an auxiliary response file (George et al 19922.4), which contains an array AD(J) that XSPEC multiplies into RD(I,J) as follows:

\begin{displaymath}R_D(I,J) \rightarrow R_D(I,J) * A_D(J)\end{displaymath}

Conventionally, the response is in units of cm2.

f(E): The Model Spectrum

The model spectrum, f(E), is calculated within XSPEC using the energy ranges defined by the response file :

\begin{displaymath}f_D(J) = \int_{E_{J-1}}^{E_J} f(E) dE\end{displaymath}

and is in units of photons/cm2/s. XSPEC allows the construction of composite models consisting of additive components (e.g., power-laws, blackbodys, and so forth), and multiplicative components, which modify additive components by an energy-dependent factor (e.g., photoelectric absorption, edges, ...). Convolution and mixing models can then perform sophisticated operations on the result. Models can be defined in algebraic notation. For example, the following expression:

\begin{displaymath}{\rm phabs ( power + phabs ( bbody ) ) }\end{displaymath}

defines an absorbed blackbody (phabs (bbody)) added to a power-law (power). The result then is modified by another absorption component (phabs).

For a more detailed explanation of models, see Chapter 6.

Fits and Confidence Intervals

Once data have been read in and a model defined, XSPEC uses a modified Levenberg-Marquardt algorithm (based on CURFIT from Bevington, 1969) to find the best-fit values of the model parameters. The algorithm used is a local one, so the user should be aware that it is possible for the fitting process to get stuck in a local minimum and not find the global best-fit. The process also goes much faster (and is more likely to find the true minimum) if the initial model parameters are set to sensible values.

At the end of a fit, XSPEC will write out the best-fit parameter values, along with estimated confidence intervals. These confidence intervals are one sigma and are calculated from the derivatives of the fit statistic with respect to the model parameters. However, the confidence intervals are not reliable and should be used for indicative purposes only.

XSPEC has a separate command (error or uncertainty) to derive confidence intervals for one interesting parameter, which it does by fixing the parameter of interest at a particular value and fitting for all the other parameters. New values of the parameter of interest are chosen until the appropriate delta-statistic value is obtained. XSPEC uses a bracketing algorithm followed by an iterative cubic interpolation to find the parameter value at each end of the confidence interval.

To compute confidence regions for several parameters at a time XSPEC runs a grid on these parameters. XSPEC also will display a contour plot of the confidence regions of any two parameters.

next up [*] [*]
Next: Helpful Hints Up: Spectral Fitting and XSPEC Previous: Introduction
Ben Dorman