About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/region-projection.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 region-projection Context: sherpa

Synopsis

Creates a contour plot of confidence regions using the PROJECTION algorithm. The commands REG-PROJ and REGPROJ are abbreviated equivalents.

Syntax

sherpa> REGION-PROJECTION [<dataset range> | ALLSETS] <arg_1> <arg_2>

where <dataset range> = #, or more generally #:#,#:#,..., such that #
specifies a dataset number, and #:# represents an inclusive range of
datasets; one may specify multiple inclusive ranges by separating them
with commas. The default is to compute contours using data from all
appropriate datasets.

Description

The two command-line arguments may be:

REGION-PROJECTION Command Arguments

Argument Description
<sherpa_modelname>.{<paramname> | <#>} A specified model component parameter (e.g., GAUSS.pos).
<modelname>.{<paramname> | <#>} A specified model component parameter (e.g., g.pos).

The user may configure REGION-PROJECTION via the Sherpa state object structure regproj. The current values of the fields of this structure may be displayed using the command print(sherpa.regproj), or using the more verbose Sherpa/S-Lang module function list_regproj().

The structure fields are:

regproj Structure Fields

Field Description
fast If 1, use a fast optimization algorithm (LEVENBERG-MARQUARDT or SIMPLEX) regardless of the current METHOD. If 0, use the current METHOD.
expfac A multiplicative factor that expands the grid limits estimated by the COVARIANCE algorithm, if the grid limits are determined automatically (see arange, and below).
arange If 1, the grid limits are to be determined automatically. If 0, the grid limits are specified (see min and max).
min An array of length two giving the grid minima for each plot axis. These are always linear quantities, regardless of the setting of log (see below). The array is ignored if arange = 1.
max An array of length two giving the grid maxima for each plot axis. These are always linear quantities, regardless of the setting of log (see below). The array is ignored if arange = 1.
log An array of length two specifying whether to use linear (0) or logarithmic (1) spacing of grid points along each plot axis.
nloop An array of length two specifying the number of grid points along each plot axis.
sigma An array of arbitrary length specifying the number of sigma for each contour. The length of the array specifies the number of contours.

Field values may be set using directly. If the field does not contain an array, e.g.,

sherpa> sherpa.regproj.arange = 0

and if it does contain an array, e.g.,

sherpa> sherpa.regproj.nloop = [25,20]

NOTE: strict checking of value inputs is not done, i.e., the user can errantly change arrays to scalars, etc. To restore the default settings of the structure at any time, use the Sherpa/S-Lang module function restore_regproj().

The confidence regions are determined by varying each selected parameter's value on the determined (arange = 1) or specified (arange = 0) grid, computing the best-fit statistic at each grid point, and interpolating on the grid. REGION-PROJECTION differs from REGION-UNCERTAINTY in that all other thawed parameters are allowed to float to new best-fit values, instead of being fixed to their best-fit values. This makes REGION-PROJECTION contours more accurate, but causes their computation to proceed more slowly. For a fuller theoretical description of error estimation, see PROJECTION, UNCERTAINTY, and COVARIANCE.

If arange = 1, then the grid limits for the plot are determined automatically. For increased speed, the grid limits are determined using the error estimates from COVARIANCE. The covariance errors are computed assuming a change in fit statistic from the best-fit value of delta_S, which is a function of the largest value of sigma (e.g., delta_S = 11.8 if the statistic is chi-square and 3 is the largest element of the array sigma. The covariance errors are then multiplied by expfac and are subtracted from and added to the best-fit parameter values to determine the lower and upper grid limits.

Note that the output of COVARIANCE may be adversely affected if the problem is not well-posed (since a matrix inversion is involved in the error calculation), or if the fit did not reach its local minimum. If the plot does not appear correct, consider running COVARIANCE to check the errors, and/or setting the plot limits manually.

For increased speed, the best fit at each grid point is calculated using the LEVENBERG-MARQUARDT optimization method if fast = 1 and a chi-square statistic is used to fit; the user's chosen optimization method is then reset after the plot is shown. (If fast = 1 and a non-chi-square statistic is used during fitting, then the SIMPLEX method is used instead.)

The grid-point values and best-fit statistics at each grid point may be retrieved using the Sherpa/S-Lang module function get_regproj. See the examples below.

Example 1

List the current and default values of the regproj structure, and restore the default values:

sherpa> sherpa.regproj.arange = 0
sherpa> sherpa.regproj.log = [1,1]
sherpa> sherpa.regproj.sigma = [1,3,5]
sherpa> list_regproj()
Parameter   Current         Default                        Description
----------------------------------------------------------------------
fast              1               1    Switch to LM/simplex: 0(n)/1(y)
expfac            3               3          Expansion factor for grid
arange            0               1              Auto-range: 0(n)/1(y)
min           [0,0]           [0,0]          Minimum values, each axis
max           [0,0]           [0,0]          Maximum values, each axis
log           [1,1]           [0,0]  Log-spacing: 0(n)/1(y), each axis
nloop       [10,10]         [10,10]   Number of grid points, each axis
sigma       [1,3,5]         [1,2,3]      Number of sigma, each contour
sherpa> restore_regproj()
sherpa> list_regproj()
Parameter   Current         Default                        Description
----------------------------------------------------------------------
fast              1               1    Switch to LM/simplex: 0(n)/1(y)
expfac            3               3          Expansion factor for grid
arange            1               1              Auto-range: 0(n)/1(y)
min           [0,0]           [0,0]          Minimum values, each axis
max           [0,0]           [0,0]          Maximum values, each axis
log           [0,0]           [0,0]  Log-spacing: 0(n)/1(y), each axis
nloop       [10,10]         [10,10]   Number of grid points, each axis
sigma       [1,2,3]         [1,2,3]      Number of sigma, each contour

Example 2

Determine 1- and 2-sigma confidence regions for a fit:

sherpa> READ DATA example1.dat
sherpa> PARAMPROMPT OFF
sherpa> SOURCE = POLYNOM1D[my]
sherpa> THAW my.c1 my.c2
sherpa> my.c0.min = -10
sherpa> FIT
...
sherpa> sherpa.regproj.sigma = [1,2]
sherpa> sherpa.regproj.expfac = 4
sherpa> REGION-PROJECTION my.c0 my.c2
Region-Projection: computing grid size with covariance...done.
                   outer grid loop 20% done...
                   outer grid loop 40% done...
                   outer grid loop 60% done...
                   outer grid loop 80% done...
Minimum: 0.255419
Levels are: 2.55142 6.43642
...

Example 3

Determine 1- and 2-sigma confidence regions for a fit using manually set grid limits:

sherpa> sherpa.regproj.arange = 0
sherpa> sherpa.regproj.min = [-15,0]
sherpa> sherpa.regproj.max = [15,2]
sherpa> REGION-PROJECTION my.c0 my.c2
Region-Projection: grid size set by user.
                   outer grid loop 20% done...
                   outer grid loop 40% done...
                   outer grid loop 60% done...
                   outer grid loop 80% done...
Minimum: 0.255419
Levels are: 2.55142 6.43642

Example 4

Save the results of REGION-PROJECTION to an ASCII file:

[...run REGION-PROJECTION...]
sherpa> my_var = get_regproj()
sherpa> writeascii("my_output.dat",my_var.x0,my_var.x1,my_var.y)
sherpa> quit
Goodbye.
unix> more my_output.dat
-15     0       12.8958
-15     0.222222        14.7571
-15     0.444444        18.5405
...

CHANGES IN CIAO 3.2

Prior to CIAO 3.2 the REGION-PROJECTION command could not be used until the dataset had been fit. This was done to ensure that the parameter values were at their best-fit location, but caused problems when fitting multiple datasets or loading previously-saved analysis sessions. This restriction has now been removed. Please note that the results of REGION-PROJECTION may not be valid unless the parameters are at their best-fit values.

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.