next up previous contents index
Next: Calculation of a Model Up: 6.2 Tasks of the Previous: Preparations

Fitting of Spectra

 

Given an observed X-ray spectrum one wants to reduce and summarize the information about the energy state of the radiating object by fitting it to a model that depends on adjustable parameters. Such a model can simply be a convenient class of functions, such as exponentials, and the fit supplies the appropriate coefficients. The spectrum can also be described by reasonable parameters of a phenomenological model like a thermal bremsstrahlung model. Last but not least the model's parameters come from some underlying theory that the spectrum is supposed to satisfy, as the spectrum of a black body or a Raymond-Smith spectrum of a thermal plasma. To achieve this goal one has to choose a figure-of-merit function (merit function for short) that measures the agreement between the observed and the modeled spectrum. The parameters of the model are adjusted to find a minimum in the merit function, yielding a set of best-fit parameters.  

Since the observed data are subject to statistical fluctuations and measurement errors they never exactly fit the used model, even if that model is correct.   So it is necessary to test the goodness-of-fit against some statistical standard.   Also one would like to know the likely errors of the best-fit parameters reflecting the statistic of the observed data.

The merit function used in this spectral package is the so called tex2html_wrap_inline17855 function, which is assumed to be a function of a model tex2html_wrap_inline17857 depending on parameters tex2html_wrap_inline17859 and N normally distributed quantities tex2html_wrap_inline17861 (data), where the difference between model and data is normalized to the standard deviations tex2html_wrap_inline17863 (errors) of the data:

  displaymath17865

The tex2html_wrap_inline17867 value has to be minimized. The whole method is called least-squares fitting.     It is shown in the literature that least-squares fitting can be derived from a maximum likelihood function,   if the data fluctuations are independent and normally distributed.

The nonlinear least-squares fitting procedure used in this package is a standard one known as Levenberg-Marquardt method   [Bevington1969, Press et al.1986].

Fitting of X-ray spectra can be performed by two EXSAS commands: FIT/SPECTRUM and MODEL/SPECTRUM. Both commands are calling the same computer program. Whereas MODEL/SPECTRUM is the more general command, FIT/SPECTRUM gives for simple cases more comfort to the user. The latter command is a MIDAS procedure, which is calling two commands: BIN/DETECTOR, MODEL/SPECTRUM and optional PLOT/FITTED_SPECTRUM. There are convenient defaults with respect to the command line like standard models and names for calibration files. That means, that if one is using the full capacity of defaults, only the model and the name of the spectrum has to be given. But file names, which can be given via command line, cannot be defined in the parameter file. They will be always overwritten by the names of higher priority given on the command level or by default names.

The standard session for fitting will be a single fit to one spectrum. But in general fitting can be performed with many models tex2html_wrap_inline17869 and up to 250 data sets. The results can be output either to a single file or to as many files as fits were performed. In the first case only the model parameters with their errors and a few other fit related numbers are stored.    

In the last case each file contains the whole information like the output of a single fit. A standard plot of this file can be produced by the command PLOT/FIT_SPECTRUM.

Another task, which can be performed with MODEL/SPECTRUM, is a grid search of tex2html_wrap_inline17871 .     This can be reached by choosing the proper mode of the corresponding model parameters. The tex2html_wrap_inline17873 can be done in one or two dimensions and is restricted to tex2html_wrap_inline17875 grid points. The parameters, which don't belong to the grid, can either be fitted or fixed. The command PLOT/CHI2_CONTOUR can be used to give a proper graphical output.

Spectral fitting is not restricted to directly observed pulse height spectra. It can be applied also to photon flux spectra,   which are unfolded from a detector response.   In this case special care must be taken. Special knowledge, how the spectrum was received, would be useful, if not necessary.

Sometimes it is useful to calculate tex2html_wrap_inline17877 of an observed spectrum from a model of given parameters. In this case the fitting is reduced to a comparison,   which can be done with the command MODEL/SPECTRUM in the compare mode. Such a comparison can be made with count rate as well as photon flux spectra, of course.


next up previous contents index
Next: Calculation of a Model Up: 6.2 Tasks of the Previous: Preparations

If you have problems/suggestions please send mail to rosat_svc@mpe-garching.mpg.de