Skip to content

Commit 702255f

Browse files
committed
update api docs for distributions
1 parent 95bd5e5 commit 702255f

File tree

13 files changed

+77
-150
lines changed

13 files changed

+77
-150
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ tags
1818
# Sphinx
1919
_build
2020
docs/jupyter_execute
21+
docs/**/generated/*
2122

2223
# Merge tool
2324
*.orig

docs/source/api/distributions/continuous.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
Continuous
33
**********
44

5-
.. currentmodule:: pymc.distributions.continuous
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated/
78

89
Uniform
910
Flat
@@ -38,6 +39,3 @@ Continuous
3839
Moyal
3940
AsymmetricLaplace
4041
PolyaGamma
41-
42-
.. automodule:: pymc.distributions.continuous
43-
:members:

docs/source/api/distributions/discrete.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
Discrete
33
********
44

5-
.. currentmodule:: pymc.distributions.discrete
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
78

89
Binomial
910
BetaBinomial
@@ -21,6 +22,3 @@ Discrete
2122
Categorical
2223
OrderedLogistic
2324
OrderedProbit
24-
25-
.. automodule:: pymc.distributions.discrete
26-
:members:

docs/source/api/distributions/mixture.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
Mixture
33
*******
44

5-
.. currentmodule:: pymc.distributions.mixture
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
8+
79
Mixture
810
NormalMixture
911
MixtureSameFamily
10-
11-
.. automodule:: pymc.distributions.mixture
12-
:members:

docs/source/api/distributions/multivariate.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
Multivariate
33
************
44

5-
.. currentmodule:: pymc.distributions.multivariate
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
78

89
MvNormal
910
MvStudentT
@@ -18,6 +19,3 @@ Multivariate
1819
MatrixNormal
1920
KroneckerNormal
2021
CAR
21-
22-
.. automodule:: pymc.distributions.multivariate
23-
:members:

docs/source/api/distributions/simulator.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ Simulator
44

55
.. currentmodule:: pymc.distributions.simulator
66
.. autosummary::
7+
:toctree: generated
78

89
SimulatorRV
910
Simulator
1011
KullbackLiebler
11-
12-
.. automodule:: pymc.distributions.simulator
13-
:members:

docs/source/api/distributions/timeseries.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ Timeseries
44

55
.. currentmodule:: pymc.distributions.timeseries
66
.. autosummary::
7+
:toctree: generated
8+
79
AR1
810
AR
911
GaussianRandomWalk
1012
GARCH11
1113
EulerMaruyama
1214
MvGaussianRandomWalk
1315
MvStudentTRandomWalk
14-
15-
.. automodule:: pymc.distributions.timeseries
16-
:members:
Lines changed: 25 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,129 +1,42 @@
1-
****************************************************************
2-
Transformations of a random variable from one space to another
3-
****************************************************************
4-
5-
Note that for convenience these entities can be addressed as
6-
``pm.transforms.``\ *X* for any name *X*, although they are actually
7-
implemented as ``pm.distributions.transforms.``\ *X*.
8-
9-
.. currentmodule:: pymc.distributions.transforms
10-
11-
12-
.. contents ::
13-
14-
..
15-
.. autosummary::
16-
17-
Transform
18-
stick_breaking
19-
logodds
20-
interval
21-
log_exp_m1
22-
ordered
23-
log
24-
sum_to_1
25-
circular
26-
CholeskyCovPacked
27-
Chain
28-
1+
***************
2+
Transformations
3+
***************
294

5+
.. currentmodule:: pymc.transforms
306

317
Transform Instances
328
~~~~~~~~~~~~~~~~~~~
339

3410
Transform instances are the entities that should be used in the
35-
``transform`` parameter to a random variable constructor. These are
36-
initialized instances of the Transform Classes, which are described
37-
below.
38-
39-
.. glossary::
40-
41-
``stick_breaking``
42-
Instantiation of :class:`~pymc.distributions.transforms.StickBreaking`
43-
:class:`~pymc.distributions.transforms.Transform` class for use in the ``transform``
44-
argument of a random variable.
45-
46-
``logodds``
47-
Instantiation of
48-
:class:`~pymc.distributions.transforms.LogOdds` :class:`~pymc.distributions.transforms.Transform` class
49-
for use in the ``transform`` argument of a random variable.
50-
51-
``interval``
52-
Alias of
53-
:class:`~pymc.distributions.transforms.Interval` :class:`~pymc.distributions.transforms.Transform` class
54-
for use in the ``transform`` argument of a random variable.
55-
56-
``log_exp_m1``
57-
Instantiation of
58-
:class:`~pymc.distributions.transforms.LogExpM1` :class:`~pymc.distributions.transforms.Transform` class
59-
for use in the ``transform`` argument of a random variable.
11+
``transform`` parameter to a random variable constructor.
6012

61-
``lowerbound``
62-
Alias of
63-
:class:`~pymc.distributions.transforms.LowerBound` :class:`~pymc.distributions.transforms.Transform` class
64-
for use in the ``transform`` argument of a random variable.
65-
66-
``upperbound``
67-
Alias of
68-
:class:`~pymc.distributions.transforms.UpperBound` :class:`~pymc.distributions.transforms.Transform` class
69-
for use in the ``transform`` argument of a random variable.
70-
71-
``ordered``
72-
Instantiation of
73-
:class:`~pymc.distributions.transforms.Ordered` :class:`~pymc.distributions.transforms.Transform` class
74-
for use in the ``transform`` argument of a random variable.
75-
76-
``log``
77-
Instantiation of
78-
:class:`~pymc.distributions.transforms.Log` :class:`~pymc.distributions.transforms.Transform` class
79-
for use in the ``transform`` argument of a random variable.
80-
81-
82-
``sum_to_1``
83-
Instantiation of
84-
:class:`~pymc.distributions.transforms.SumTo1` :class:`~pymc.distributions.transforms.Transform` class
85-
for use in the ``transform`` argument of a random variable.
86-
87-
88-
``circular``
89-
Instantiation of
90-
:class:`~pymc.distributions.transforms.Circular` :class:`~pymc.distributions.transforms.Transform` class
91-
for use in the ``transform`` argument of a random variable.
92-
93-
Transform Base Classes
94-
~~~~~~~~~~~~~~~~~~~~~~
95-
96-
Typically the programmer will not use these directly.
97-
98-
.. autoclass:: Transform
99-
:members:
13+
.. autosummary::
14+
:toctree: generated
10015

16+
simplex
17+
logodds
18+
interval
19+
log_exp_m1
20+
ordered
21+
log
22+
sum_to_1
23+
circular
10124

10225
Transform Composition Classes
10326
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10427

105-
.. autoclass:: Chain
106-
:members:
107-
.. autoclass:: CholeskyCovPacked
108-
:members:
28+
.. autosummary::
29+
:toctree: generated
10930

31+
Chain
32+
CholeskyCovPacked
11033

11134
Specific Transform Classes
11235
~~~~~~~~~~~~~~~~~~~~~~~~~~
11336

114-
.. autoclass:: Log
115-
:members:
116-
.. autoclass:: LogExpM1
117-
:members:
118-
.. autoclass:: LogOdds
119-
:members:
120-
.. autoclass:: Interval
121-
:members:
122-
.. autoclass:: Ordered
123-
:members:
124-
.. autoclass:: SumTo1
125-
:members:
126-
.. autoclass:: StickBreaking
127-
:members:
128-
.. autoclass:: Circular
129-
:members:
37+
.. autosummary::
38+
:toctree: generated
39+
40+
LogExpM1
41+
Ordered
42+
SumTo1
Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
1-
*******************************************
2-
Distribution utility classes and functions
3-
*******************************************
1+
**********************
2+
Distribution utilities
3+
**********************
44

5-
.. currentmodule:: pymc.distributions
5+
.. currentmodule:: pymc
66
.. autosummary::
7+
:toctree: generated
78

89
Distribution
910
Discrete
1011
Continuous
1112
NoDistribution
1213
DensityDist
13-
14-
.. autoclass:: Distribution
15-
.. autoclass:: Discrete
16-
.. autoclass:: Continuous
17-
.. autoclass:: NoDistribution
18-
.. autoclass:: DensityDist
19-
:members:

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
# myst and panels config
119119
jupyter_execute_notebooks = "off"
120120
myst_enable_extensions = ["colon_fence", "deflist", "dollarmath", "amsmath", "substitution"]
121-
panels_add_bootstrap_css = False
121+
myst_heading_anchors = 0
122122

123123
# The reST default role (used for this markup: `text`) to use for all
124124
# documents.

docs/source/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Use this to cite the library:
143143

144144
Salvatier J., Wiecki T.V., Fonnesbeck C. (2016) Probabilistic programming in Python using PyMC3. PeerJ Computer Science 2:e55 [DOI: 10.7717/peerj-cs.55.](https://doi.org/10.7717/peerj-cs.55)
145145

146-
For detailed advise on citing PyMC go to {ref
146+
For detailed advise on citing PyMC go to {ref}`citing_pymc`.
147147
See [Google Scholar](https://scholar.google.de/scholar?oi=bibs&hl=en&authuser=1&cites=6936955228135731011) for a continuously updated list of papers citing PyMC3.
148148

149149
:::{toctree}

pymc/distributions/transforms.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,38 @@ def log_jac_det(self, value, *inputs):
157157

158158

159159
simplex = Simplex()
160+
160161
logodds = LogOddsTransform()
162+
logodds.__doc__ = """
163+
Instantiation of :class:`aeppl.transforms.LogOddsTransform`
164+
for use in the ``transform`` argument of a random variable."""
165+
161166
interval = IntervalTransform
167+
interval.__doc__ = """
168+
Instantiation of :class:`aeppl.transforms.IntervalTransform`
169+
for use in the ``transform`` argument of a random variable."""
170+
162171
log_exp_m1 = LogExpM1()
172+
log_exp_m1.__doc__ = """
173+
Instantiation of :class:`pymc.transforms.LogExpM1`
174+
for use in the ``transform`` argument of a random variable."""
175+
163176
ordered = Ordered()
177+
ordered.__doc__ = """
178+
Instantiation of :class:`pymc.transforms.Ordered`
179+
for use in the ``transform`` argument of a random variable."""
180+
164181
log = LogTransform()
182+
log.__doc__ = """
183+
Instantiation of :class:`aeppl.transforms.LogTransform`
184+
for use in the ``transform`` argument of a random variable."""
185+
165186
sum_to_1 = SumTo1()
187+
sum_to_1.__doc__ = """
188+
Instantiation of :class:`pymc.transforms.SumTo1`
189+
for use in the ``transform`` argument of a random variable."""
190+
166191
circular = CircularTransform()
192+
circular.__doc__ = """
193+
Instantiation of :class:`aeppl.transforms.CircularTransform`
194+
for use in the ``transform`` argument of a random variable."""

pymc/model.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -515,9 +515,9 @@ class Model(Factor, WithMemoization, metaclass=ContextMeta):
515515
"""Encapsulates the variables and likelihood factors of a model.
516516
517517
Model class can be used for creating class based models. To create
518-
a class based model you should inherit from :class:`~.Model` and
519-
override :meth:`~.__init__` with arbitrary definitions (do not
520-
forget to call base class :meth:`__init__` first).
518+
a class based model you should inherit from :class:`~pymc.Model` and
519+
override the `__init__` method with arbitrary definitions (do not
520+
forget to call base class :meth:`pymc.Model.__init__` first).
521521
522522
Parameters
523523
----------
@@ -600,6 +600,7 @@ def __init__(self, mean=0, sigma=1, name=''):
600600
with Model() as model:
601601
CustomModel(mean=1, name='first')
602602
CustomModel(mean=2, name='second')
603+
603604
"""
604605

605606
if TYPE_CHECKING:

0 commit comments

Comments
 (0)