# Sampling Brownian motion

I wish to sample standard linear Brownian motions on the interval $[0,1]$. I do this by dividing the interval into $n$ equal sub-intervals, deciding $B(0)=0$, and letting $B\left(\frac{k}{n}\right)=B\left(\frac{k-1}{n}\right)+\mathcal{N}\left(0,\frac{\sigma^2}{n}\right)$ for $k\ge 1$, after deciding for some $\sigma>0$. I do this $s$ times.

My question is as follows: how large should $n$ and $s$ be so I'll feel comfortable enough to say that the sampled Brownian motion represent, in some sense, the real distribution of Brownian motions?

In fact, there are two questions here:

• How large should $n$ be so that the random walks should resemble, in some sense, Brownian motions?
• How large should $s$ be so that the distribution of the sampled fractional Brownian motions would resemble, in some sense, the real distribution of such fractional Brownian motions?
• We cannot hope to judge your level of comfort. – Glen_b Jun 9 '14 at 8:38
• I've learned that many times in statistics there are bounds which are "empirically proven" to provide "satisfying results". Choice of optimal parameters is done often according to empirical results and intuition. I ask for experience here. – Bach Jun 9 '14 at 8:51
• Do you have any examples of such empirical proofs of "satisfaction"? – Glen_b Jun 9 '14 at 8:59
• Peters et al. (2007) say that a random forest is "empirically proven to be better than its individual members". Breiman has suggested on its random forest model that the mtry parameter will be $\sqrt{p}$ in classification forests and $p\over 3$ in regression forests, where $p$ is the number of variables. He did not claim that this should be "satisfying", but he did have his reasons to recommend this numbers. – Bach Jun 9 '14 at 10:07
• There's the rub; 'satisfying' was the criterion you brought up, and that's subjective. With a more objective criterion, some progress might be possible. – Glen_b Jun 9 '14 at 10:09

I illustrate a simulated Brownian Bridge on my blog, using the method described here. In your case, you would use covariance function $k(s,t)=\min(s,t)$

If you want it to look good, don't hold back. You might want to consider the number of pixels in your graph, since I'm not sure you will gain much by letting $n$ be larger than that.

• I don't think the question is either about the correctness of the algorithm nor about graphical representation. The word "resemble" most likely is intended in some vague sense of "is likely to have all the salient statistical characteristics of." This is the issue @Glen_b is pursuing in comments to the question: it needs clarification from the O.P. – whuber Jun 9 '14 at 14:19
• Well, in that case, you need $n=\infty$, since otherwise, how are you going to get a nowhere differentiable function? – Placidia Jun 9 '14 at 14:37

# You are worrying about nothing

One of the nice things about Brownian motion is that it has an explicit distributional form for its incremental change over any specified time period. In fact, this requirement is built into the definition. For a one-dimensional Brownian motion process (i.e., a Wiener process) $$W = \{ W_t | t \in \mathbb{R} \}$$ with variation rate $$\sigma^2$$, one of the stipulated requirements is that:

$$W_{r+t} - W_r \sim \text{N}(0, t \cdot \sigma^2) \quad \quad \quad \text{for all } r \in \mathbb{R} \text{ and } t \geqslant 0.$$

Thus, if we have a process with starting value $$W_0 = 0$$, and we want to "sample" from the process at time values $$0 < t_1 < \cdots < t_n$$, we can generate the sampled values $$W_{t_1}, ..., W_{t_n}$$ as follows:$$^\dagger$$

$$W_{t_k} = \sum_{i=1}^k Z_k \quad \quad \quad Z_k \sim \text{N}(0, (t_k-t_{k-1}) \cdot \sigma^2).$$

An important point is that there is no requirement for the time increments to be small. Regardless of whether the time increments are large or small (or a mixture of both), the displacement of the process over each time increment is independent of the other displacements, and has the distribution specified above. Thus, we can be "comfortable" that the generated values reflect a genuine Brownian motion process without worrying about making the increments small.

$$^\dagger$$ In this formula we take $$t_0 \equiv 0$$.