Skip to content

Commit c009717

Browse files
Update api docs for distributions (#5266)
* update api docs for distributions * add aeppl to intersphinx mapping Co-authored-by: Michael Osthege <michael.osthege@outlook.com>
1 parent cce1613 commit c009717

File tree

20 files changed

+132
-207
lines changed

20 files changed

+132
-207
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/Makefile renamed to Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
8-
BUILDDIR = _build
8+
SOURCEDIR = docs/source
9+
BUILDDIR = docs/_build
910

1011
# User-friendly check for sphinx-build
1112
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
@@ -51,9 +52,11 @@ help:
5152

5253
clean:
5354
rm -rf $(BUILDDIR)/*
55+
rm -rf $(SOURCEDIR)/api/**/generated
56+
rm -rf docs/jupyter_execute
5457

5558
html:
56-
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
59+
$(SPHINXBUILD) $(SOURCEDIR) $(BUILDDIR) -b html
5760
@echo
5861
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
5962

docs/source/api.rst

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,34 @@ API Reference
1515
api/smc
1616
api/step_methods
1717
api/inference
18-
api/plots
1918

20-
Indices and tables
21-
===================
19+
--------------
20+
API extensions
21+
--------------
2222

23-
* :ref:`genindex`
24-
* :ref:`modindex`
25-
* :ref:`search`
23+
Plots, stats and diagnostics
24+
----------------------------
25+
Plots, stats and diagnostics are delegated to the
26+
:doc:`ArviZ <arviz:index>`.
27+
library, a general purpose library for
28+
"exploratory analysis of Bayesian models".
29+
30+
* Functions from the `arviz.plots` module are available through ``pymc.<function>`` or ``pymc.plots.<function>``,
31+
but for their API documentation please refer to the :ref:`ArviZ documentation <arviz:plot_api>`.
32+
33+
* Functions from the `arviz.stats` module are available through ``pymc.<function>`` or ``pymc.stats.<function>``,
34+
but for their API documentation please refer to the :ref:`ArviZ documentation <arviz:stats_api>`.
35+
36+
ArviZ is a dependency of PyMC and so, in addition to the locations described above,
37+
importing ArviZ and using ``arviz.<function>`` will also work without any extra installation.
38+
39+
Generalized Linear Models (GLMs)
40+
--------------------------------
41+
42+
Generalized Linear Models are delegated to the
43+
`Bambi <https://bambinos.github.io/bambi>`_.
44+
library, a high-level Bayesian model-building
45+
interface built on top of PyMC.
46+
47+
Bambi is not a dependency of PyMC and should be installed in addition to PyMC
48+
to use it to generate PyMC models via formula syntax.

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: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22
Simulator
33
**********
44

5-
.. currentmodule:: pymc.distributions.simulator
5+
.. currentmodule:: pymc
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: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
Timeseries
33
**********
44

5-
.. currentmodule:: pymc.distributions.timeseries
5+
.. currentmodule:: pymc
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: 10 additions & 16 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

8-
Distribution
9-
Discrete
10-
Continuous
11-
NoDistribution
12-
DensityDist
13-
14-
.. autoclass:: Distribution
15-
.. autoclass:: Discrete
16-
.. autoclass:: Continuous
17-
.. autoclass:: NoDistribution
18-
.. autoclass:: DensityDist
19-
:members:
9+
Distribution
10+
Discrete
11+
Continuous
12+
NoDistribution
13+
DensityDist

docs/source/api/glm.rst

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/source/api/plots.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/source/api/stats.rst

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)