Parameter
- class glotaran.parameter.parameter.Parameter(label: str = None, full_label: str = None, expression: str = None, maximum: int | float = inf, minimum: int | float = - inf, non_negative: bool = False, value: float | int = nan, vary: bool = True)[source]
Bases:
numpy.typing._array_like._SupportsArray
A parameter for optimization.
Optimization Parameter supporting numpy array operations.
- Parameters
label (str, optional) – The label of the parameter., by default None
full_label (str, optional) – The label of the parameter with its path in a parameter group prepended. , by default None
expression (str, optional) – Expression to calculate the parameters value from, e.g. if used in relation to another parameter. , by default None
maximum (int, optional) – Upper boundary for the parameter to be varied to., by default np.inf
minimum (int, optional) – Lower boundary for the parameter to be varied to., by default -np.inf
non_negative (bool, optional) – Whether the parameter should always be bigger than zero., by default False
value (float, optional) – Value of the parameter, by default np.nan
vary (bool, optional) – Whether the parameter should be changed during optimization or not. , by default True
Attributes Summary
Expression to calculate the parameters value from.
The label of the parameter with its path in a parameter group prepended.
Label of the parameter
The upper bound of the parameter.
The lower bound of the parameter.
Indicates if the parameter is non-negativ.
The standard error of the optimized parameter.
The expression of the parameter transformed for evaluation within a ParameterGroup.
The value of the parameter
Indicates if the parameter should be optimized.
Methods Summary
Creates a parameter from a list or numeric value.
Gets the parameter value and bounds with expression and non-negative constraints applied.
Sets all values of the parameter to the values of the corresponding parameter in the group.
Sets the value from an optimization result and reverses non-negative transformation.
Returns true if the label is valid string.
Methods Documentation
- property expression: str | None
Expression to calculate the parameters value from.
This can used to set a relation to another parameter.
- classmethod from_list_or_value(value: int | float | list, default_options: dict = None, label: str = None) Parameter [source]
Creates a parameter from a list or numeric value.
- Parameters
value – The list or numeric value.
default_options – A dictionary of default options.
label – The label of the parameter.
- get_value_and_bounds_for_optimization() tuple[float, float, float] [source]
Gets the parameter value and bounds with expression and non-negative constraints applied.
- property non_negative: bool
Indicates if the parameter is non-negativ.
If true, the parameter will be transformed with and .
Always False if expression is not None.
- set_from_group(group: ParameterGroup)[source]
Sets all values of the parameter to the values of the corresponding parameter in the group.
Notes
For internal use.
- Parameters
group – The
glotaran.parameter.ParameterGroup
.
- set_value_from_optimization(value: float)[source]
Sets the value from an optimization result and reverses non-negative transformation.