Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: December 2013

URL: http://cxc.harvard.edu/sherpa/ahelp/get_iter_method_name.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.9 Sherpa v1

get_iter_method_name

Context: methods

Synopsis

Return the name of the current iterative fitting method

Syntax

get_iter_method_name()

Description

The get_iter_method_name command prints the current iterative fitting method, which is set with the set_iter_method command. The return value can be either "none" (default), "primini", or "sigmarej". All available iterative fitting methods are returned by the list_iter_methods command. The essence of an iterative fitting method is that the chosen fit optimization method can be called several times, until some criterion is met. The fit statistic and optimization methods are selected independently of the iterative fitting method.

If the iterative fitting method is "none", then no iterative fitting is done when "fit()" is called; the optimization method is called once, and Sherpa otherwise operates as expected.

Primini's method is used for re-calculating statistical errors using the best-fit model parameters from the *previous* fit, until the fit can no longer be improved.

The sigma-rejection method is based on the IRAF SFIT function. In successive fits, data points for which ((data - model) / error) exceeds some threshold are added to the filter, and automatically excluded from the next fit.

Primini's method and sigma-rejection can only be called when the fit statistic is a chi-squared statistic; it cannot be used with least-squares, Cash or C-statistic.

Example 1

sherpa> set_stat("chi2datavar")
sherpa> set_method("neldermead")
sherpa> print(get_iter_method_name())
primini
sherpa> fit()

Primini's iterative fitting method is used to fit data set 1. When "fit()" is run, the Nelder-Mead optimization method is called until the fit can no longer be improved.

Example 2

sherpa> set_stat("chi2xspecvar")
sherpa> set_method("levmar")
sherpa> print(get_iter_method_name())
none
sherpa> fit(2)

The current iterative fitting method is set to the default value of 'none', so no iterative fitting is done when data set 2 is fit; the Levenberg-Marquardt optimization method is called once, as expected.

Example 3

sherpa> set_stat("chi2gehrels")
sherpa> set_method("simplex")
sherpa> print(get_iter_method_name())
sigmarej
sherpa> fit(2,3)

The sigma-rejection iterative fitting method is used in the simultaneous fitting of data sets 2 and 3. When "fit(2,3)" is run, the Nelder-Mead optimization method is called until the fit can no longer be improved.

Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

See Also

confidence
get_conf, get_covar, get_int_proj, get_int_unc, get_proj, get_reg_proj, get_reg_unc
contrib
get_chart_spectrum
data
get_areascal, get_arf, get_arf_plot, get_axes, get_backscal, get_bkg, get_bkg_plot, get_bkg_scale, get_coord, get_counts, get_data, get_data_plot, get_dep, get_dims, get_error, get_exposure, get_grouping, get_indep, get_quality, get_rmf, get_specresp, get_staterror, get_syserror
filtering
get_filter
fitting
calc_stat_info, fit, get_fit, get_stat_info
info
get_default_id, list_stats
methods
get_draws, get_iter_method_opt, get_method, list_iter_methods, set_iter_method, set_iter_method_opt
modeling
get_model, get_model_component, get_model_component_image, get_model_component_plot, get_model_plot, get_num_par, get_order_plot, get_par, get_pileup_model, get_response, get_source, get_source_component_image, get_source_component_plot, image_source
plotting
get_split_plot, plot_fit
psfs
get_kernel, get_psf
statistics
get_chisqr_plot, get_delchi_plot, get_prior, get_sampler, get_stat
utilities
calc_chisqr, calc_stat, get_analysis, get_rate
visualization
contour_resid, get_ratio, get_resid, image_fit, image_getregion

Last modified: December 2013
Smithsonian Institute Smithsonian Institute

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