elisa.models.parameter#
The parameter.
- class AssignmentTracker[source]#
Bases:
objectTrack component assignment of a parameter.
Methods
append(cid, pname)Append a new assignment record.
get_comp_param(comp_ids)Get the earliest component assignment record within comp_ids.
remove(cid, pname)Remove an assignment record.
- class ParamInfo(name: str | Callable[[ParamIDStrMapping], str], latex: str | Callable[[ParamIDStrMapping], str], default: Any, bound: str, prior: str, log: bool, fixed: bool, tracker: AssignmentTracker, id_to_value: Callable[[ParamIDValMapping], JAXFloat], dist: Distribution | None = None, composite: bool = False, integrate: IntegralFactory | bool = False)[source]#
Bases:
NamedTupleParameter information.
Methods
count(value, /)Return number of occurrences of value.
index(value[, start, stop])Return first index of value.
- name: str | Callable[[dict[str, str]], str]#
Plain name of the parameter.
It is a getter function for composite parameter.
- latex: str | Callable[[dict[str, str]], str]#
\(\LaTeX\) format of the parameter.
It is a getter function for composite parameter.
- tracker: AssignmentTracker#
Component assignment tracker.
- dist: Distribution | None#
NumPyro distribution for the parameter.
- class Parameter[source]#
Bases:
ABCParameter base.
Attributes
Default value of the parameter.
Whether the parameter is fixed.
\(\LaTeX\) format of the parameter.
Whether the parameter is parameterized in a logarithmic scale.
Plain name of the parameter.
- class ParameterHelper(name: str, latex: str | None, default: Any | None = None)[source]#
Bases:
ParameterHandle name, latex, and default value of a parameter.
Attributes
Default value of the parameter.
fixedWhether the parameter is fixed.
\(\LaTeX\) format of the parameter.
logWhether the parameter is parameterized in a logarithmic scale.
Plain name of the parameter.
- class DistParameter(name: str, dist: Distribution, default: float, *, min: float | None = None, max: float | None = None, log: bool = False, fixed: bool = False, latex: str | None = None)[source]#
Bases:
ParameterHelperDefine a parameter by a distribution.
- Parameters:
name (
str) – Parameter name.dist (
Distribution) – Numpyro distribution from which the parameter is sampled.default (
float) – Parameter default value.min (
float|None) – Parameter minimum value, for display purpose only. The default is None.max (
float|None) – Parameter maximum value, for display purpose only. The default is None.log (
bool) – Whether the parameter is parameterized in a logarithmic scale. The default is False.fixed (
bool) – Whether the parameter is fixed. The default is False.latex (
str|None) – \(\LaTeX\) format of the parameter. The default is as name.
Attributes
Default value of the parameter.
Whether the parameter is fixed.
latex\(\LaTeX\) format of the parameter.
Whether the parameter is parameterized in a logarithmic scale.
namePlain name of the parameter.
- class UniformParameter(name: str, default: float, min: float, max: float, *, log: bool = False, fixed: bool = False, latex: str | None = None)[source]#
Bases:
DistParameterDefine the parameter by a uniform distribution.
- Parameters:
name (
str) – Parameter name.default (
float) – Parameter default value.min (
float) – Parameter minimum value.max (
float) – Parameter maximum value.log (
bool) – Whether the parameter is logarithmically uniform. The default is False.fixed (
bool) – Whether the parameter is fixed. The default is False.latex (
str|None) – \(\LaTeX\) format of the parameter. The default is as name.
Attributes
Default value of the parameter.
Whether the parameter is fixed.
\(\LaTeX\) format of the parameter.
Whether the parameter is logarithmically uniform.
Parameter maximum value.
Parameter minimum value.
Plain name of the parameter.
- class ConstantParameter(name: str, value: Any, latex: str | None = None)[source]#
Bases:
ParameterHelperConstant parameter.
- Parameters:
Attributes
defaultDefault value of the parameter.
Constant parameter is fixed.
latex\(\LaTeX\) format of the parameter.
Constant parameter is not logarithmically parameterized.
namePlain name of the parameter.
- class ConstantValue(name: str, value: float, latex: str | None = None)[source]#
Bases:
ConstantParameterParameter with a fixed value.
- Parameters:
Attributes
Default value of the parameter.
fixedConstant parameter is fixed.
latex\(\LaTeX\) format of the parameter.
logConstant parameter is not logarithmically parameterized.
namePlain name of the parameter.
- class ConstantInterval(name: str, interval: Sequence[float], method: Literal['quadgk', 'quadcc', 'quadts', 'romberg', 'rombergts'] = 'quadgk', latex: str | None = None, **kwargs)[source]#
Bases:
ConstantParameterConstant parameter to be integrated over a given interval.
When assigning
ConstantIntervalparameters to a model component, the model will be evaluated according to the following formula:\[\frac{1}{\prod_i (b_i - a_i)} \int f(E, \vec{\theta}(\vec{p}, \vec{q})) \, \mathrm{d} \vec{p}\]where \(f\) is the model function, \(\vec{\theta}\) is the parameter vector of the model, \(\vec{p}\) is the
ConstantIntervalparameters, \(\vec{q}\) is the other parameters, and \(a_i\) and \(b_i\) are the intervals given by \(\vec{p}\).- Parameters:
Attributes
Default value of the parameter.
fixedConstant parameter is fixed.
latex\(\LaTeX\) format of the parameter.
logConstant parameter is not logarithmically parameterized.
Numerical integration method.
namePlain name of the parameter.
References
[1]
- class CompositeParameter(params: Parameter | Sequence[Parameter], op: Callable[[...], Array], op_name: str, op_latex: str | None = None, *, op_symbol: Literal['+', '-', '*', '/', '^'] | None = None)[source]#
Bases:
ParameterCombine parameters to create a new parameter.
- Parameters:
params (
Parameter|Sequence[Parameter]) – Parameters to be combined.op (
Callable[...,Array]) – Function applied to params. The function should take the same number and order of arguments as params and return a single value. The function must be compatible withJAX.op_name (
str) – Name of the composition operator op.op_latex (
str|None) – \(\LaTeX\) format of the composition operator op. The default is as op_name.
Attributes
Default value of the parameter.
If the sub-parameters are all fixed.
\(\LaTeX\) format of the parameter.
If the sub-parameters are all logarithmically parameterized.
Plain name of the parameter.