Fitting Implementation
Redesign Home Problem Fitting Plotting Data Modeling CCfits

Fitting implementation makes use of Strategy and Template patterns. What these gain us is allowing both the objective function to be minimized and the algorithm used to minimize it are completely interchangeable within the code. The Strategy Pattern allows interchangeability while the Template pattern greatly reduces the amount of new code that needs to be written to implement new algorithms

Note that the objective function is some function of the Observed Predicted data. Currently, the predicted data in XSPEC's forward folding method always consists of the convolution of detector response with the theoretical model.

It is important to point out that XSPEC12's abstract formulation of the problem sees the Response object as a mapping from theoretical (energy) space to observed (channel detector) space. Thus it is not actually necessary that the Predicted data be represented by a convolution operation: future use may require that this mapping be performed otherwise (say, by a Monte Carlo simulation). This would entail writing a new Response class with a different implementation of R(C,E)*M(E).

Both future developers and users will be able to implement new algorithms and statistics as modules loaded at runtime, provided they conform to  well-defined interface prescription.

[Redesign Home]

Xspec Xspec Home Page

HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: Wednesday, 02-Mar-2011 11:28:57 EST