Random (pmrf.Random)
- pmrf.Random(distribution: AbstractDistribution, *, constraint: AbstractConstraint | None = None, value: Array | ndarray | bool | number | bool | int | float | complex | None = None, scale: float = 1.0, fixed: bool = False) Param
Create a parameter initialized with a random distribution.
Used as the main factory to define parameters for Bayesian inference. Can also be used for bounded optimization, in which case the random variable’s domain (constraint) is used as the bounds.
For built-in distributions, see
pmrf.distributions. For built-in constraints, seepmrf.constraints.- Parameters:
distribution (AbstractDistribution) – The probability distribution for the parameter.
constraint (Optional[AbstractConstraint], optional) – An optional constraint to apply.
value (Optional[ArrayLike], optional) – The initial value. If None, the distribution’s mean is used.
scale (float, optional) – The scaling factor to apply, by default 1.0.
fixed (bool, optional) – Whether to freeze the parameter, by default False.
- Returns:
The random parameter.
- Return type:
- Raises:
ValueError – If value is None and the distribution does not implement mean().