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 = None, vary: bool = True)[source]

Bases: object

A parameter for optimization.

Parameters
  • label – The label of the parameter.

  • full_label (str) – The label of the parameter with its path in a parameter group prepended.

Attributes Summary

expression

The expression of the parameter.

full_label

The label of the parameter with its path in a parameter group prepended.

label

Label of the parameter

maximum

The upper bound of the parameter.

minimum

The lower bound of the parameter.

non_negative

Indicates if the parameter is non-negativ.

standard_error

The standard error of the optimized parameter.

transformed_expression

The expression of the parameter transformed for evaluation within a ParameterGroup.

value

The value of the parameter

vary

Indicates if the parameter should be optimized.

Methods Summary

from_list_or_value

Creates a parameter from a list or numeric value.

get_value_and_bounds_for_optimization

Gets the parameter value and bounds with expression and non-negative constraints applied.

set_from_group

Sets all values of the parameter to the values of the corresponding parameter in the group.

set_value_from_optimization

Sets the value from an optimization result and reverses non-negative transformation.

valid_label

Returns true if the label is valid string.

Methods Documentation

property expression

The expression of the 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.

property full_label

The label of the parameter with its path in a parameter group prepended.

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 label

Label of the parameter

property maximum

The upper bound of the parameter.

property minimum

The lower bound of the parameter.

property non_negative

Indicates if the parameter is non-negativ.

If true, the parameter will be transformed with p' = \log{p} and p = \exp{p'}.

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.

property standard_error

The standard error of the optimized parameter.

property transformed_expression

The expression of the parameter transformed for evaluation within a ParameterGroup.

classmethod valid_label(label: str)bool[source]

Returns true if the label is valid string.

property value

The value of the parameter

property vary

Indicates if the parameter should be optimized.

Always False if expression is not None.