Skip to content

Commit 9dc5b7c

Browse files
committed
Update docstring formatting
1 parent dbaed34 commit 9dc5b7c

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

RELEASE-NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ It also brings some dreadfully awaited fixes, so be sure to go through the chang
2020
- `OrderedProbit` distribution added (see [#4232](https://github.com/pymc-devs/pymc3/pull/4232)).
2121
- `plot_posterior_predictive_glm` now works with `arviz.InferenceData` as well (see [#4234](https://github.com/pymc-devs/pymc3/pull/4234))
2222
- Add `logcdf` method to all univariate discrete distributions (see [#4387](https://github.com/pymc-devs/pymc3/pull/4387)).
23+
- Add `random` method to `MvGaussianRandomWalk` (see [#4388](https://github.com/pymc-devs/pymc3/issues/4337))
2324

2425
### Maintenance
2526
- Fixed bug whereby partial traces returns after keyboard interrupt during parallel sampling had fewer draws than would've been available [#4318](https://github.com/pymc-devs/pymc3/pull/4318)

pymc3/distributions/timeseries.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -485,24 +485,22 @@ def random(self, point=None, size=None):
485485
486486
Examples
487487
-------
488-
Create one sample from a 2-dimensional Gaussian random walk with 10 timesteps::
488+
.. code-block:: python
489489
490-
mu = np.array([1.0, 0.0])
491-
cov = np.array([[1.0, 0.0], [0.0, 2.0]])
492-
sample = MvGaussianRandomWalk(mu, cov, shape=(10, 2)).random()
490+
with pm.Model():
491+
mu = np.array([1.0, 0.0])
492+
cov = np.array([[1.0, 0.0],
493+
[0.0, 2.0]])
493494
494-
Create three samples from a 2-dimensional Gaussian random walk with 10 timesteps::
495+
# draw one sample from a 2-dimensional Gaussian random walk with 10 timesteps
496+
sample = MvGaussianRandomWalk(mu, cov, shape=(10, 2)).random()
495497
496-
mu = np.array([1.0, 0.0])
497-
cov = np.array([[1.0, 0.0], [0.0, 2.0]])
498-
sample = MvGaussianRandomWalk(mu, cov, shape=(10, 2)).random(size=3)
498+
# draw three samples from a 2-dimensional Gaussian random walk with 10 timesteps
499+
sample = MvGaussianRandomWalk(mu, cov, shape=(10, 2)).random(size=3)
499500
500-
Create four samples from a 2-dimensional Gaussian random walk with 10
501-
timesteps, indexed with a (2, 2) array::
502-
503-
mu = np.array([1.0, 0.0])
504-
cov = np.array([[1.0, 0.0], [0.0, 2.0]])
505-
sample = MvGaussianRandomWalk(mu, cov, shape=(10, 2)).random(size=(2, 2))
501+
# draw four samples from a 2-dimensional Gaussian random walk with 10 timesteps,
502+
# indexed with a (2, 2) array
503+
sample = MvGaussianRandomWalk(mu, cov, shape=(10, 2)).random(size=(2, 2))
506504
"""
507505

508506
# for each draw specified by the size input, we need to draw time_steps many

0 commit comments

Comments
 (0)