@@ -476,14 +476,17 @@ class Bound(object):
476
476
477
477
Example
478
478
-------
479
- # In general Bounded distribution need to be defined befor model context
480
- boundedNormal = pm.Bound(pm.Normal, lower=0.0)
479
+ # Bounded distribution can be defined before the model context
480
+ PositiveNormal = pm.Bound(pm.Normal, lower=0.0)
481
481
with pm.Model():
482
- par1 = boundedNormal('par1', mu=0.0, sd=1.0, testval=1.0)
482
+ par1 = PositiveNormal('par1', mu=0.0, sd=1.0, testval=1.0)
483
+ # or within the model context
484
+ NegativeNormal = pm.Bound(pm.Normal, upper=0.0)
485
+ par2 = NegativeNormal('par2', mu=0.0, sd=1.0, testval=1.0)
483
486
484
487
# or you can define it implicitly within the model context
485
- par2 = pm.Bound(pm.Normal, lower=0 .0)(
486
- 'par2 ', mu=0.0, sd=1.0, testval=1.0)
488
+ par3 = pm.Bound(pm.Normal, lower=-1.0, upper=1 .0)(
489
+ 'par3 ', mu=0.0, sd=1.0, testval=1.0)
487
490
"""
488
491
489
492
def __init__ (self , distribution , lower = - np .inf , upper = np .inf ):
0 commit comments