Parameter expressions are used to link model component parameters:
sherpa> [CREATE] <modelname>.{<paramname> | <#>} => <paramExpr>
where <modelname> is the name that has been given to a model component
by the user. Note that either <paramname> or <#> may specify a
parameter.
The parameter expression, <paramExpr>,
to which the parameter is being linked,
may be composed of one, or more (combined algebraicly),
of the following elements:
<modelname>.{<paramname> | <#>} | A model component parameter. |
<model_stackname> | A model expression, specified via a model stack name. |
A parameter expression may
be an algebraic combination of these elements that may include numerical
values and the following operators: + - * / ( ) < > { }.
The command UNLINK may be used to remove a link between model
parameters:
sherpa> UNLINK <modelname>.{<paramname> | <#>}
Link one model parameter to another:
sherpa> ERASE ALL
sherpa> PARAMPROMPT ON
Model parameter prompting is on
sherpa> GAUSS[modelb]
modelb.fwhm parameter value [10]
modelb.pos parameter value [0]
modelb.ampl parameter value [1]
sherpa> GAUSS[modelf]
modelf.fwhm parameter value [10]
modelf.pos parameter value [0]
modelf.ampl parameter value [1]
sherpa> modelf.ampl => 0.5*modelb.ampl
The last command in this series uses a
model parameter expression,
to link the ampl
parameter of modelf to 0.5 multiplied by
the ampl parameter of modelb.
That is, the amplitudes of two Gaussian models are linked, where
one is half that of the other.
Note that model parameter expressions cannot be created
within the model parameter prompting.
Note that the link may be removed as follows:
sherpa> UNLINK modelf.ampl
Link one model parameter to another:
sherpa> PARAMPROMPT OFF
Model parameter prompting is off
sherpa> POW[modelc]
sherpa> POW[modeld]
sherpa> POW[modele]
sherpa> modelc.1 => modele.1
sherpa> modelc.3 => modeld.3 + modele.3
The next-to last command in this series links the
first parameter (gamma) of modelc
to the first parameter of modele.
The last command in this series links the
third parameter (ampl) of modelc
to the sum of the third parameters of
modeld and modele.
Note that the links may be removed as follows:
sherpa> UNLINK modelc.1
sherpa> UNLINK modelc.3
Link a model parameter to a model expression:
sherpa> ERASE ALL
sherpa> SIN[modeli]
sherpa> SOURCE = modeli
sherpa> PeriodVariation = POLY[modela]
sherpa> modeli.period => PeriodVariation
The first command, SIN[modeli],
assigns the name modeli to the Sherpa
model component SIN.
The second command defines this model component as the
source model to be used for fitting.
The third command,
PeriodVariation = POLY[modela], creates a
model stack.
The final command links the parameter period of modeli to the
parameter expression PeriodVariation (which is composed of the
model component modela).
Note that the following parameter expression
syntax is currently not allowed:
modeli.period => POLY[modela].
- sherpa
-
autoest,
background,
create,
create_model,
createparamset,
fit,
freeze,
get_defined_models,
get_model_params,
get_models,
get_num_par,
get_par,
get_stackexpr,
getx,
gety,
guess,
instrument,
integrate,
is_paramset,
jointmode,
kernel,
lineid,
mdl,
modelexpr,
modelstack,
nestedmodel,
noise,
paramprompt,
paramset,
pileup,
rename,
run_fit,
set_par,
set_paramset,
set_stackexpr,
source,
thaw,
truncate,
unlink
|