Skip to content

Commit dbaed34

Browse files
committed
Improve comment clarity in MvNormal._random
Moves the brittle comment in MvRandom._random's docstring to the actual location in the code for clarity.
1 parent 4b6bb80 commit dbaed34

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pymc3/distributions/timeseries.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ def _random(self, sigma, mu, size, sample_shape):
275275
"""Implement a Gaussian random walk as a cumulative sum of normals.
276276
axis = len(size) - 1 denotes the axis along which cumulative sum would be calculated.
277277
This might need to be corrected in future when issue #4010 is fixed.
278-
Lines 291-295 set the starting point of each instance of the random walk to 0."
279278
"""
280279
if size[len(sample_shape)] == sample_shape:
281280
axis = len(sample_shape)
@@ -284,6 +283,8 @@ def _random(self, sigma, mu, size, sample_shape):
284283
rv = stats.norm(mu, sigma)
285284
data = rv.rvs(size).cumsum(axis=axis)
286285
data = np.array(data)
286+
287+
# the following lines center the random walk to start at the origin.
287288
if len(data.shape) > 1:
288289
for i in range(data.shape[0]):
289290
data[i] = data[i] - data[i][0]

0 commit comments

Comments
 (0)