Skip to the navigation links
Last modified: 1 November 2022

URL: https://cxc.cfa.harvard.edu/sherpa/bugs/confidence.html

Bugs: confidence


Bugs

Confidence fails after fitting only background data; source model must also be set.

Currently, an attempt to run the confidence command after a fit to a background data set using fit_bkg, when no source model has been assigned to the associated source data set, will cause Sherpa to fail. This is a bug which will be addressed in a future release of the software, to allow the source and background data sets to be treated independently (as fit_bkg allows a background data set to be fit independently from its associated source data set).

sherpa> load_pha("source.pi")
sherpa> load_bkg("bkg.pi")
sherpa> set_bkg_model("xsphabs.abs1*powlaw1d.bkgp1")

sherpa> fit_bkg()
sherpa> conf(1,1)
IdentifierErr: model stack is empty

sherpa> set_model("xsphabs.abs1*powlaw1d.srcp1")
sherpa> conf(1,1)
abs1.nh lower bound:    -0.00527305
bkgp1.gamma lower bound:        -0.410748
bkgp1.gamma upper bound:        0.659292
bkgp1.ampl lower bound: -2.04293e-06
abs1.nh upper bound:    0.00672851
srcp1.gamma lower bound:        -0.0750826
bkgp1.ampl upper bound: 4.28454e-06
srcp1.gamma upper bound:        0.0763327
srcp1.ampl lower bound: -1.24576e-05
srcp1.ampl upper bound: 1.28531e-05
Dataset               = 1
Confidence Method     = confidence
Iterative Fit Method  = None
Fitting Method        = levmar
Statistic             = chi2gehrels
confidence 1-sigma (68.2689%) bounds:
   Param            Best-Fit  Lower Bound  Upper Bound
   -----            --------  -----------  -----------
   abs1.nh         0.0178329  -0.00527305   0.00672851
   srcp1.gamma       1.92493   -0.0750826    0.0763327
   srcp1.ampl    0.000174607 -1.24576e-05  1.28531e-05
   bkgp1.gamma     -0.167417    -0.410748     0.659292
   bkgp1.ampl    2.46545e-06 -2.04293e-06  4.28454e-06