Prior.constrain#
- Prior.constrain(lower, upper, mass=0.95, kwargs=None)[source]#
Create a new prior with a given mass constrained within the given bounds.
Wrapper around
preliz.maxent
.- Parameters:
- Returns:
Prior
The maximum entropy prior with a mass constrained to the given bounds.
Examples
Create a Beta distribution that is constrained to have 95% of the mass between 0.5 and 0.8.
dist = Prior( "Beta", ).constrain(lower=0.5, upper=0.8)
Create a Beta distribution with mean 0.6, that is constrained to have 95% of the mass between 0.5 and 0.8.
dist = Prior( "Beta", mu=0.6, ).constrain(lower=0.5, upper=0.8)