Var.new_value()

Contents

Var.new_value()#

classmethod Var.new_value(value, name='', inference=None, convert='default')[source]#

Initializes a strong variable without a distribution.

Parameters:
  • value (Any) – The value of the variable.

  • distribution – The probability distribution of the variable.

  • name (str, default: '') – The name of the variable. If you do not specify a name, a unique name will be automatically generated upon initialization of a Model.

  • inference (TypeAliasType, default: None) – Additional information that can be used to set up inference algorithms.

  • convert (Callable[[Any], Any] | Literal['default'], default: 'default') – A function used to process the value of this variable. The default uses the function stored in convert_value, which is jax.numpy.asarray.

See also

Var.new_param

Initializes a strong variable that acts as a model parameter.

Var.new_obs

Initializes a strong variable that acts as an observed variable.

Var.new_calc

Initializes a weak variable that is a function of other variables.

Return type:

Var

Examples

A simple value variable without a name:

>>> x = lsl.Var.new_value(1.0)
>>> x
Var(name="")