as_param

pmrf.parameters.as_param(value: Any = None, *, constraint: AbstractConstraint | None = None, scale: float | None = None, as_free: bool = False, as_fixed: bool = False) → Param

Coerces a value into a parameter.

The incoming value can be an existing parameter or parax variable, or any parameter-like object (float, array etc.).

constraint is the parameter’s validity: it is intersected with any validity and range the value already has, and a prior is truncated to the result. A parameter’s own scale overrides scale; the two are never multiplied.

Parameters:
  • value (Any, optional) – The declared value of the parameter.

  • constraint (Optional[AbstractConstraint], optional) – The parameter’s validity, in declared space. See pmrf.parameters.constraints.

  • scale (float, optional) – The units value is written in, used unless value is a parameter with its own scale. None, the default, leaves the scale unset (acting as 1.0).

  • as_free (bool, optional) – Whether to enforce that the value is a free parameter. If False, incoming values will keep the variability (e.g. constants will remain constants). If True, all values will be co-erced into free parameters.

  • as_fixed (bool, optional) – Whether to enforce that the value is a fixed parameter. If False, incoming values will keep the variability (e.g. constants will remain constants). If True, all values will be wrapped in pmrf.Fixed().

Returns:

A fixed parameter.

Return type:

pmrf.Param