next up previous contents
Next: fit Up: Fit Commands Previous: chain

            error, uncertain: determine confidence intervals of a fit

Determine the confidence region for a model parameter.

Syntax:           error [[stopat <ntrial> <toler>] [maximum <redchi>]

[ <delta fit statistic>] [ <model param range>...]]

where

<model param range> =:: <modelName:><first param>-- <last param>

determines the ranges of parameters to be examined, and <delta fit statistic> (distinguished from the model parameter indices by the inclusion of a decimal point), is the change in fit statistic used.

Each indicated parameter is varied, within its allowed hard limits, until the value of the fit statistic, minimized by allowing all the other non-frozen parameters to vary, is equal to the last value of fit statistic determined by the fit command plus the indicated  <delta fit statistic>. Note that before the error command is executed, the data must be fitted. The initial default values are the range 1—1 and the delta fit statistic of 2.706, equivalent to the 90% confidence region for a single interesting parameter. The number of trials and the tolerance for determining when the critical fit statistic is reached can be modified by preceeding them with the stopat keyword. Initially, the values are 10 trials with a tolerance of 0.01 in fit statistic. If a new minimum is found in the course of finding the error, then the calculation is aborted and control returned to the user. The maximum keyword ensures that error will not be run if the reduced chi-squared of the best fit exceeds  <redchi>. The default value for  <redchi> is 2.0.

Examples:

Assume that the current model has four model parameters.

XSPEC12> error 1-4

//Estimate the 90% confidence ranges for each parameter.

XSPEC12> error 9.0

//Estimate the confidence range for parameters 1-4 with delta fit

// statistic = 9.0, equivalent to the 3 sigma range.

XSPEC12> error 2.706 1 3 1. 2

//Estimate the 90% ranges for parameters 1 and 3, and the 1. sigma

// range for parameter 2.

XSPEC12> error 4

//Estimate the 1. sigma range for parameter 4.

XSPEC12> error stop 20,,3

//Estimate the 1-sigma range for parameter 3 after resetting the number

// of trials to 20.Note that the tolerance field had to be included

//(or at least skipped over).