Skip to content

Commit 1ad7ad2

Browse files
Expand RandomWalk docstring
1 parent a4827f0 commit 1ad7ad2

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

pymc/distributions/timeseries.py

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,43 @@ def rv_op(cls, init_dist, innovation_dist, steps, size=None):
122122
class RandomWalk(Distribution):
123123
r"""RandomWalk Distribution.
124124
125-
TODO: Expand docstrings
125+
Parameters
126+
----------
127+
init_dist : unnamed_distribution
128+
Unnamed univariate or multivariate distribution of the initial value.
129+
Unnamed refers to distributions created with the ``.dist()`` API.
130+
131+
.. warning:: init_dist will be cloned, rendering it independent of the one passed as input.
132+
133+
innovation_dist : unnamed_distribution
134+
Unnamed univariate or multivariate distribution of the innovation term for each step.
135+
Unnamed refers to distributions created with the ``.dist()`` API.
136+
137+
.. warning:: innovation_dist will be cloned, rendering it independent of the one passed as input.
138+
139+
steps : int, optional
140+
Number of steps in the Random Walk (steps > 0). Only needed if shape is not
141+
provided.
142+
143+
Notes
144+
-----
145+
RandomWalk is a generic subclass, used to implement specific Random Walk distributions
146+
such as GaussianRandomWalk, MvGaussianRandomWalk, and MvStudentTRandomWalk. It can also
147+
be used directly to build custom Random Walks by passing arbitrary ``init_dist`` and
148+
``innovation_dist``.
149+
150+
Examples
151+
--------
152+
.. code-block:: python
153+
154+
import pymc as pm
155+
156+
with pm.Model():
157+
init_dist = pm.Normal.dist(0, 10)
158+
innovation_dist = pm.Normal.dist(0, 1)
159+
rw = pm.RandomWalk(
160+
"rw", init_dist=init_dist, innovation_dist=innovation_dist, steps=100
161+
)
126162
"""
127163

128164
rv_type = RandomWalkRV

0 commit comments

Comments
 (0)