From ff9aa695c5d23d3829ae7cffe410c860630fbe57 Mon Sep 17 00:00:00 2001 From: diegomed11 Date: Fri, 12 Dec 2025 18:29:50 -0500 Subject: [PATCH] DOC: Expand RandomWalk docstring --- pymc/distributions/timeseries.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pymc/distributions/timeseries.py b/pymc/distributions/timeseries.py index 500cd95b47..9bd002f2c5 100644 --- a/pymc/distributions/timeseries.py +++ b/pymc/distributions/timeseries.py @@ -122,9 +122,28 @@ def rv_op(cls, init_dist, innovation_dist, steps, size=None): class RandomWalk(Distribution): - r"""RandomWalk Distribution. + r""" + Random Walk distribution. + + A random walk is a stochastic process where the position at time :math:`t` + is the sum of the position at time :math:`t-1` and a random step (innovation). + + .. math:: + X_t = X_{t-1} + \epsilon_t - TODO: Expand docstrings + where :math:`\epsilon_t` follows the distribution specified by `innovation_dist`. + + Parameters + ---------- + innovation_dist : Distribution + The distribution of the innovations (steps). This should be an instance + of a PyMC distribution (created via `.dist()`), describing the random + noise added at each step. + steps : int, optional + The number of steps in the random walk. + kwargs + Additional arguments passed to the distribution, such as `init_dist` + (distribution of the initial state) or dimensions. """ rv_type = RandomWalkRV