next up previous contents pdf.png
Next: 5.13 Discarding Observations Up: 5 Algorithms Previous: 5.11 Light Curves

Subsections



5.12 Automated Spectral Fitting

An excellent introduction to the concept of fitting X-ray spectra can be found in one of Keith Arnaud's PowerPoint presentations.

The FIT_SPECTRA stage of AE (§7.11) can automate spectral fitting by running the XSPEC package (Arnaud, 1996) on each source's extraction data products. The XSPEC command interface is mediated through the Tcl scripting language, providing powerful programming features such as string manipulations, looping, conditions, and ASCII file I/O. An XSPEC script following certain interface requirements described in §7.11 must be supplied to AE.

Several such scripts, implementing simple spectral models, are distributed in the AE package. These carefully crafted scripts (originally developed by Konstantin Getman) fit the observed spectrum, estimate 90% confidence intervals on the fit parameters, calculate fluxes and estimate 90% flux confidence intervals over several energy bands, and produce various text and PostScript output. Both of XSPECs fit statistics, $\chi^2$ and the C-statistic, are supported. The MODEL_CHANGES_FILENAME mechanism described in §7.11 can be used to override some script parameters without editing the script. If you choose to build your own XSPEC script that is compatible with AE, please consider providing it back to the AE community for use by your colleagues.

The following scripts are distributed with AE:

Spectral fitting of weak sources remains a poorly understood task among the community of X-ray observers. If $\chi^2$ is to be used there seems to be little consensus on the best trade off between group size and the number of groups. For both $\chi^2$ and C-statistic methods there seems to be little consensus on the conditions necessary for the parameter error estimates produced by the delta-fit-statistic methods in XSPEC to be appropriate/reliable.

5.12.1 Background Spectra and the C-statistic

The C-statistic, an application of the Likelihood Ratio test, has long been recognized (Cash, 1979) as more appropriate for low-count data than the traditional $\chi^2$ statistic. The concept of ``subtracting'' a background does not exist when using the C-statistic since the method involves computing the likelihood of the observed data set itself, the set of individual X-ray events. One can however consider the background data to be part of the generalized observation, form a model that predicts all the observed data (events from both the target and background regions), and calculate the C-statistic on the data and model. For some time now the C-statistic in XSPEC has provided this capability (Appendix B of the XSPEC manual). When a background spectrum is supplied and the C-statistic is selected, the source and background data are simultaneously modeled (Arnaud, see http://heasarc.gsfc.nasa.gov/docs/xanadu/xspec/wstat.ps) using a method derived by Wachter et al. (1979).

Several observers using this Cstat-with-background capability have noted that seemingly undesirable fits are fairly common. For thermal models, typically the plasma temperature will be obviously too low, leading to very poor fits at high energies. (Examples of this problem will be shown later.)

We believe that these problems are the result of the under-constrained nature of the background model used by Wachter et al. (1979). That model represents the incident background flux in each spectral bin with an independent parameter, with no constraints. Thus, in an ungrouped ACIS spectrum with 500 channels the Wachter background model contains 500 free parameters. (The best-fit background parameter values are computed by algebraic manipulation (Wachter et al., 1979) and are thus hidden from XSPECs Cstat minimization search.)

In our view, such an extremely flexible model of the ACIS background is inappropriate. For many of our ACIS sources, both the extracted source spectrum and the background spectrum have relatively few counts (far fewer than the $\sim$500 parameters in the Wachter background model); in any single channel both spectra will typically have only zero or one observed count. As it tries to follow the data, this flexible background model should be driven to zero (an unphysical result) in all channels that have no source or background events. One can imagine the more troubling tendency of the background model to try to ``follow'' the source counts, i.e. to spike upward at each channel where there is a source count. This could allow the background model to siphon off flux that should be represented in the source model. More generally, one should expect that this flexible background would be very sensitive to the random (physically meaningless) alignment of the source and background counts, e.g. whether a source and background count of similar energy happened to fall in the same channel or in adjacent channels.

Motivated by these concerns, we decided to implement a smoother (more constrained) physics-free model for ACIS background spectra to replace the Wachter background model when the C-statistic is in use. We arbitrarily chose a model family consisting of continuous piecewise-linear functions with 2 to 10 vertexes; an example of such a model is shown in Figure 5. The model has 2 to 10 parameters representing the X-ray fluxes at the vertices's. The vertices's are placed on the energy scale so that they divide the energy range into intervals with approximately equal numbers of observed counts in the background spectrum (0.1 to 10 keV). Vertex energies are chosen to coincide with the energies of actual events in the background--this helps to prevent the vertex flux from being driven to the hard limit of zero during the fitting process. We use the name cplinear to refer to this model. Obviously, this smooth model would not be appropriate for very high quality background spectra that have significant of structure.

Figure 5: Example of a continuous piecewise-linear (cplinear) background model.
\includegraphics[width=6.0in]{figures/cplinear_example.eps}

The AE fitting scripts configure XSPEC as shown in Figure 6. The background spectrum is compared (via the C-statistic) to a cplinear model passed through a flat ARF, rather than through the Chandra ARF. Thus we are in effect modeling the observed ACIS background, not any sort of incident astrophysical background. The source spectrum is compared (via the C-statistic) to the sum of two models:

XSPEC simultaneously fits these models, i.e. minimizes the sum of the C-statistic computed on the source spectrum (likelihood of the source spectrum given the source model) and the C-statistic computed on the background spectrum (likelihood of the background spectrum given the background model). It's worth repeating that this strategy of simultaneously maximizing the Poisson likelihood of all the data (source spectrum and background spectrum) is NOT new; Wachter's method also does this. We have simply adopted a more constrained background model, and are searching for its best-fit parameters within the context of XSPECs minimization machinery rather than solving for background parameters algebraically.

Figure 6: Configuration of maximum likelihood model for source and background spectra. The green plus sign represents the addition of two predicted instrumental spectra (vectors); the red plus sign represents the addition of two C-statistic values (corresponding to multiplication of the likelihood of the source and background data).
\includegraphics[width=6.0in]{figures/XSPEC_config.eps}

We have found that the cplinear model produces far fewer fits that are obviously poor. In Figure 7, below each example of a poor fit produced by the Wachter background method (rows 1 and 3) is shown an arguably better fit to the same source produced by the cplinear method (rows 2 and 4). Appendix B compares the Wachter and cplinear models applied to real ACIS spectra.

Figure 7: Spectral models for six sources derived using the Wachter (rows 1 and 3) and cplinear (rows 2 and 4) background models (see Figure 6). The Wachter plots (rows 1 and 3) show the observed cumulative net spectrum (stair-step curve) and the best-fit thermal plasma model (continuous curve) with residuals. Note that the fit is often poor. The cplinear plots are more complex. Two stair-step curves (black and red) show the cumulative spectra observed in the source aperture and background region. The continuous red curve shows the cplinear model of the background spectrum (often not visually distinguishable from the background data). Three black continuous curves depict the two components of the model for the events observed in the source aperture (lower curves), and their sum (upper curve). One component--a copy of the red cplinear background model, scaled down by the exposure ratio between the source and background regions--models the background in the aperture. The second component models a thermal plasma in the astrophysical source. Residuals are shown at the bottom.
\includegraphics[height=6.0in]{figures/Wachter_cplinear_comparison/F2_8_models_part1.eps}

Figure 7: (continued) Spectral models for six sources derived using the Wachter (rows 1 and 3) and cplinear (rows 2 and 4) background models.
\includegraphics[height=6.0in]{figures/Wachter_cplinear_comparison/F2_8_models_part2.eps}


next up previous contents pdf.png
Next: 5.13 Discarding Observations Up: 5 Algorithms Previous: 5.11 Light Curves
Patrick Broos
Penn State Department of Astronomy
2013-05-09