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) – The label of the parameter., by default None
full_label (str) – The label of the parameter with its path in a parameter group prepended. , by default None
expression (str) – Expression to calculate the parameters value from, e.g. if used in relation to another parameter. , by default None
maximum (int) – Upper boundary for the parameter to be varied to., by default np.inf
minimum (int) – Lower boundary for the parameter to be varied to., by default -np.inf
non_negative (bool) – Whether the parameter should always be bigger than zero., by default False
value (float) – Value of the parameter, by default np.nan
vary (bool) – Whether the parameter should be changed during optimization or not. , by default True
Attributes Summary
Expression to calculate the parameters value from.
Label of the parameter with its path in a parameter group prepended.
Label of the parameter.
Upper bound of the parameter.
Lower bound of the parameter.
Indicate if the parameter is non-negativ.
Standard error of the optimized parameter.
Expression of the parameter transformed for evaluation within a ParameterGroup.
Value of the parameter.
Indicate if the parameter should be optimized.
Methods Summary
Create a parameter from a list or numeric value.
Get the parameter value and bounds with expression and non-negative constraints applied.
Set all values of the parameter to the values of the corresponding parameter in the group.
Set the value from an optimization result and reverses non-negative transformation.
Check if a label is a valid label for
Parameter
.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]
Create a parameter from a list or numeric value.
- property full_label: str
Label of the parameter with its path in a parameter group prepended.
- Returns
The full label.
- Return type
- get_value_and_bounds_for_optimization() tuple[float, float, float] [source]
Get the parameter value and bounds with expression and non-negative constraints applied.
- property maximum: float
Upper bound of the parameter.
- Returns
The upper bound of the parameter.
- Return type
- property minimum: float
Lower bound of the parameter.
- Returns
The lower bound of the parameter.
- Return type
- property non_negative: bool
Indicate if the parameter is non-negativ.
If true, the parameter will be transformed with and .
Notes
Always False if expression is not None.
- Returns
Whether the parameter is non-negativ.
- Return type
- set_from_group(group: ParameterGroup)[source]
Set all values of the parameter to the values of the corresponding parameter in the group.
Notes
For internal use.
- Parameters
group (ParameterGroup) – The
glotaran.parameter.ParameterGroup
.
- set_value_from_optimization(value: float)[source]
Set the value from an optimization result and reverses non-negative transformation.
- Parameters
value (float) – Value from optimization.
- property standard_error: float
Standard error of the optimized parameter.
- Returns
The standard error of the parameter.
- Return type
- property transformed_expression: str | None
Expression of the parameter transformed for evaluation within a ParameterGroup.