# [Numpy-discussion] Valid algorithm for generating a 3D Wiener Process?

Daπid davidmenhur at gmail.com
Thu Sep 26 04:02:30 EDT 2013

```On 25 September 2013 19:41, David Goldsmith <d.l.goldsmith at gmail.com> wrote:

> "the 'angles' that describe the position undergo a random walk [actually,
> it would seem that they don't, since they too fail the
> varying-as-white-noise test], so the particle tends to move in the same
> direction over short intervals"--is this just another way of saying that,
> since I was varying the angles by -1, 0, or 1 unit each time, the
> simulation is susceptible to "unnaturally" long strings of -1, 0, or 1
> increments?

In the 1D case, the white noise has a gaussian probability distribution of
being positive or negative. Translated to the Wiener process, it means you
would have to sum normally distributed values. When you go 3D you can do
the same thing, taking a random displacement from a N(0,1) and two random
angles.

The issue here is that the polar angles cannot be taken uniformly, but
instead they have to be distributed proportionally  to the jacobian. As you
have it now, your particle will tend to move towards the poles. If you want
to visualize it: take a sphere and imagine dots spaced evenly at angles
(intersection of meridians and parallels, for example): they are much more
dense at the poles.

The simplest way is to do it in cartesian coordinates: take x, y, and z
independently from N(0,1). If you want to generate only one normal number
per step, consider the jacobian in the angles.

David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130926/afb9d3f9/attachment.html>
```