Skip to content

Commit 2b39a0c

Browse files
committed
Add Truncated to docs
1 parent bf843c7 commit 2b39a0c

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

docs/source/api/distributions.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Distributions
1010
distributions/multivariate
1111
distributions/mixture
1212
distributions/timeseries
13+
distributions/truncated
1314
distributions/censored
1415
distributions/simulator
1516
distributions/transforms
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*********
2+
Truncated
3+
*********
4+
5+
.. currentmodule:: pymc
6+
.. autosummary::
7+
:toctree: generated
8+
9+
Truncated

pymc/distributions/truncated.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,15 @@ class Truncated(Distribution):
111111
`SymbolicRandomVariable` graph representing the truncation process, via inverse
112112
CDF sampling (if the underlying dist has a logcdf method), or rejection sampling
113113
is returned.
114+
115+
Examples
116+
--------
117+
.. code-block:: python
118+
119+
with pm.Model():
120+
normal_dist = pm.Normal.dist(mu=0.0, sigma=1.0)
121+
truncated_normal = pm.Truncated("truncated_normal", normal_dist, lower=-1, upper=1)
122+
114123
"""
115124

116125
rv_type = TruncatedRV

0 commit comments

Comments
 (0)