Prior.constrain#
- Prior.constrain(lower, upper, **kwargs)[source]#
Create a new prior that is constrained to the given bounds.
Wrapper around
pm.find_constrained_priorwhere the initial guess is the current parameters. Will error out if no parameters are given.- Parameters:
- Returns:
PriorThe new prior that is constrained to domain.
Examples
Create a Beta distribution that is constrained between 0.5 and 0.8 using initial parameter values of alpha=2 and beta=1 for the optimization.
dist = Prior( "Beta", alpha=2, beta=1, ).constrain(lower=0.5, upper=0.8)