Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Truncated distributions to docs #6129

Merged
merged 1 commit into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/api/distributions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Distributions
distributions/multivariate
distributions/mixture
distributions/timeseries
distributions/truncated
distributions/censored
distributions/simulator
distributions/transforms
Expand Down
9 changes: 9 additions & 0 deletions docs/source/api/distributions/truncated.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*********
Truncated
*********

.. currentmodule:: pymc
.. autosummary::
:toctree: generated

Truncated
9 changes: 9 additions & 0 deletions pymc/distributions/truncated.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ class Truncated(Distribution):
`SymbolicRandomVariable` graph representing the truncation process, via inverse
CDF sampling (if the underlying dist has a logcdf method), or rejection sampling
is returned.

Examples
--------
.. code-block:: python

with pm.Model():
normal_dist = pm.Normal.dist(mu=0.0, sigma=1.0)
truncated_normal = pm.Truncated("truncated_normal", normal_dist, lower=-1, upper=1)

"""

rv_type = TruncatedRV
Expand Down