Resets negative model amplitudes to zero.
sherpa> TRUNCATE [<dataset range> | ALLSETS] [{ON | OFF}]
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 dataset is dataset number 1.
The command TRUNCATE resets any negative model amplitudes
to zero (actually, 1.e-25); truncation is
necessary for the Poisson-likelihood-based statistics of
Sherpa
(BAYES,
CASH,
and
CSTAT) to work properly (none of these
statistics allows negative model amplitudes). Note that:
-
if neither ON nor OFF is specified,
the truncation setting for the specified dataset(s) is displayed;
-
truncation is automatically turned on if the assigned
STATISTIC is BAYES,
CASH, or CSTAT; and
-
truncation is never automatically turned off.
Fitting with a linear model, using the Cash statistic:
sherpa> READ DATA example1.dat
sherpa> PARAMPROMPT OFF
Model parameter prompting is off
sherpa> SOURCE = POLYNOM1D[my]
sherpa> THAW my.c1
sherpa> my.c0.min = -10
sherpa> METHOD SIMPLEX
sherpa> STATISTIC CASH
sherpa> TRUNCATE OFF
sherpa> FIT
smplx: v1.3
smplx: initial statistic value = -9.05568E+02
Error: predicted data are zero or negative.
-- Apply commands RESET and TRUNCATE ON, and refit.
sherpa> RESET
sherpa> TRUNCATE
Model Truncation for Dataset 1: off
sherpa> TRUNCATE ON
sherpa> FIT
smplx: v1.3
smplx: initial statistic value = -9.05568E+02
smplx: converged to minimum = -1.05814E+03 at iteration = 67
smplx: final statistic value = -1.05814E+03
my.c0 -6.61366
my.c1 7.16072
- sherpa
-
autoest,
background,
bayes,
cash,
chicvar,
chidvar,
chigehrels,
chimvar,
chiprimini,
chisquare,
create,
create_model,
createparamset,
cstat,
fit,
freeze,
get_defined_models,
get_model_params,
get_models,
get_num_par,
get_par,
get_stackexpr,
get_stat_expr,
getx,
gety,
guess,
instrument,
integrate,
is_paramset,
jointmode,
kernel,
lineid,
linkparam,
mdl,
modelexpr,
modelstack,
nestedmodel,
noise,
paramprompt,
paramset,
pileup,
rename,
run_fit,
set_par,
set_paramset,
set_stackexpr,
source,
statistic,
thaw,
unlink,
userstat
|