Skip to content

Commit 142289f

Browse files
author
Junpeng Lao
committed
update docstring for Bound
1 parent 5e329a5 commit 142289f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pymc3/distributions/distribution.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,14 +476,17 @@ class Bound(object):
476476
477477
Example
478478
-------
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)
481481
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)
483486
484487
# 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)
487490
"""
488491

489492
def __init__(self, distribution, lower=-np.inf, upper=np.inf):

0 commit comments

Comments
 (0)