# Drawing random samples from GaussianRandomWalk

**URL:** <https://discourse.pymc.io/t/drawing-random-samples-from-gaussianrandomwalk/4897>\
**Category:** Questions\
**Created:** [April 19, 2020, 11:45pm UTC](https://discourse.pymc.io/t/drawing-random-samples-from-gaussianrandomwalk/4897 "2020-04-19T23:45:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gpoon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/gpoon/32/2038_2.png) [@gpoon](https://discourse.pymc.io/u/gpoon)\
**Post date:** [April 19, 2020, 11:45pm UTC](https://discourse.pymc.io/t/drawing-random-samples-from-gaussianrandomwalk/4897/1 "2020-04-19T23:45:36Z")

</div>

Hello!

I am trying to draw random samples from GaussianRandomWalk by doing something like:

with pm.Model() as model:  
a = GaussianRandomWalk(‘a’, sd=0.024, shape=25000)  
y = a.random()

Which throws the TypeError: ‘NoneType’ object is not callable

I can do this for continuous functions so I guess I am missing something but am unsure what.

Thanks for your insight,  
Gregory

---

<div class="post-metadata">

**Author:** ![nkaimcaudle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/nkaimcaudle/32/2142_2.png) [@nkaimcaudle](https://discourse.pymc.io/u/nkaimcaudle)\
**Post date:** [April 20, 2020, 12:16am UTC](https://discourse.pymc.io/t/drawing-random-samples-from-gaussianrandomwalk/4897/2 "2020-04-20T00:16:06Z")

</div>

Hi gpoon

The standard approach is to use the .dist method of a distribution outside of a model context.

```
pm.GaussianRandomWalk.dist(0.024, shape=8).random(size=100)

```

This will produce 100 random walks each of length 8. Hope this helps.

---

<div class="post-metadata">

**Author:** ![gpoon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/gpoon/32/2038_2.png) [@gpoon](https://discourse.pymc.io/u/gpoon)\
**Post date:** [April 20, 2020, 12:56am UTC](https://discourse.pymc.io/t/drawing-random-samples-from-gaussianrandomwalk/4897/3 "2020-04-20T00:56:56Z")

</div>

I tried it, outside of a model context, but now I get:

AttributeError: ‘GaussianRandomWalk’ object has no attribute ‘random’

I appreciate any suggestions. Thanks again!

---

<div class="post-metadata">

**Author:** ![nkaimcaudle](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/nkaimcaudle/32/2142_2.png) [@nkaimcaudle](https://discourse.pymc.io/u/nkaimcaudle)\
**Post date:** [April 20, 2020, 9:57am UTC](https://discourse.pymc.io/t/drawing-random-samples-from-gaussianrandomwalk/4897/4 "2020-04-20T09:57:33Z")

</div>

Try upgrading to the master branch of PyMC3 from GitHub.

---

<div class="post-metadata">

**Author:** ![gpoon](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/gpoon/32/2038_2.png) [@gpoon](https://discourse.pymc.io/u/gpoon)\
**Post date:** [April 21, 2020, 12:52am UTC](https://discourse.pymc.io/t/drawing-random-samples-from-gaussianrandomwalk/4897/5 "2020-04-21T00:52:57Z")

</div>

I upgraded to v3.8 and it goes. Thanks again!
