Xspec manual




















Taking twice the negative natural log of L and ignoring terms which depend only on the data and will thus not change as parameters are varied gives the familiar statistic : B. Gaussian data with background chi The previous section assumed that the only contribution to the observed data was from the model.

In practice, there is usually background. This can either be included in the model or taken from another spectrum file read in using the back command. In the latter case the become observed data rates from the source spectrum subtracted by the background spectrum and the are the source and background errors added in quadrature. Since the difference of two Gaussians variables is another Gaussian variable, the statistic can still be used in this case.

Poisson data cstat The likelihood for Poisson distributed data is: B. The maximum likelihood-based statistic for Poisson data, given in Cash , is : B. The final term depends only on the data and hence makes no difference to the best-fit parameters so can be replaced by Stirling's approximation to give : B. This is what is used for the statistic cstat option. Note that using the statistic instead of is not recommended since it can produce biassed results even when the number of counts is quite large see e.

Humphrey et al. If the statistic is specified as cstatN where N is an integer then the same formula is used except that the data and model are binned so that there are at least N counts in each bin. In general, this is not recommended since it is inefficient but can be useful when testing using simulations.

Poisson data with Poisson background cstat This case is more difficult than that of Gaussian data because the difference between two Poisson variables is not another Poisson variable so the background data cannot be subtracted from the source and used within the C statistic.

The combined likelihood for the source and background observations can be written as: B. Note that is the predicted background rate for the observation of the source.

If the background is uniform and the source and background observations are extracted from different sized regions then should be the background observation exposure multiplied by the the ratio of the background to source region sizes. If there is a physically motivated model for the background then this likelihood can be used to derive a statistic which can be minimized while varying the parameters for both the source and background models.

As a simple illustration suppose the source spectrum is source. The source model is an absorbed apec and the background model is a power-law. Further suppose that the background model requires a different response matrix to the source, backmod.

If there is no appropriate model for the background it is still possible to proceed. Suppose that each bin in the background spectrum is given its own parameter so that the background model is.

A standard XSPEC fit for all these parameters would be impractical however there is an analytical solution for the best-fit in terms of the other variables which can be derived by using the fact that the derivative of will be zero at the best fit.

Solving for the and substituting gives the profile likelihood: B. So, if is zero then: B. If is zero then there are two special cases. If then: B. This W statistic is used for statistic cstat if a background spectrum with Poisson statistics has been read in note that in the screen output it will still be labeled as C statistic. In practice, it works well for many cases but for weak sources and small numbers of counts in the background spectrum it can generate an obviously wrong best fit.

In the limit of large numbers of counts per spectrum bin a second-order Taylor expansion shows that tends to : B. Poisson data with Gaussian background pgstat Another possible background option is if the background spectrum is not Poisson.

For instance, it may have been generated by some model based on correlations between the background counts and spacecraft orbital position. In this case there may be an uncertainty associated with the background which is assumed to be Gaussian. In this case the same technique as above can be used to derive a profile likelihood statistic : B.

There is a special case for any bin with equal to zero: B. This is what is used for the statistic pgstat option. Poisson data with known background pstat Another possible background option is if the background spectrum is known.

Again the same technique as above can be used to derive a profile likelihood statistic : B. This is what is used for the statistic pstat option. Bayesian analysis of Poisson data with Poisson background lstat An alternative approach to fitting Poisson data with background is to use Bayesian methods. In this case instead of solving for the background rate parameters we marginalize over them writing the joint probability distribution of the source parameters as : B.

The data file tells XSPEC how many total photon counts were detected by the instrument in a given channel. The background-subtracted count rate is given by :. 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. The default chatter level for the log file is Turn on the log file default xspec. Close the log file. Open the log file mylog. Set the log file chattiness to Initial default values are 2 to 10 keV for 0 redshift.

The energy range redshifted to the observed range must be contained by the range covered by the current data sets which determine the range over which the model is evaluated.

Values outside this range will be automatically reset to the extremes. Note that the energy values are two separate arguments and are NOT connected by a dash see parameter ranges in the freeze command description. The error algorithm is to draw parameter values from the distribution and calculate a luminosity.

The parameter values distribution is assumed to be a multivariate Gaussian centered on the best-fit parameters with sigmas from the covariance matrix. This is only an approximation in the case that fit statistic space is not quadratic. Note that fit must be run before using the error option and that the model cannot be changed using model , editmod , addc , or delc between running the fit and calculating the luminosity error.

Examples: The current data have significant response to data within 1 to 18 keV. Calculate the current luminosity over 6. The simple rules for expressions are : 1. The energy term, or the radius term for mixing model, must be 'e' or 'E' in the expression. Other words, which are not numerical constants nor internal functions, are assumed to be model parameters. If a convolution model varies with the location on the spectrum to be convolved, the special variable. E may be used to refer to the convolution point.

The maximum number of model parameters is The expression may contain spaces for better readability. Valid types are add, mul, mix, con. Default values are 1. Note that mdefine can also be used to display and delete previously defined models.

The command mdefine with no arguments will display the name, type, and expression of all defined models. A single argument of a model name will display name, type, and expression just for that model.



0コメント

  • 1000 / 1000