as_param (pmrf.as_param)

pmrf.as_param(value: Any = None, *, constraint: AbstractConstraint | None = None, scale: float = 1.0, 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.).

Any scaling and constraints are automatically intersected.

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

  • constraint (Optional[AbstractConstraint], optional) – The constraint to apply to the parameter. See pmrf.constraints.

  • scale (float, optional) – The scaling factor to apply, by default 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