Brownian motion, or random walk, can be regarded as the trace of some cumulative normal random numbers.
brownian.motion(n = 10, xlim = c(-20, 20), ylim = c(-20, 20), ...)
None (invisible NULL
).
Number of points in the scatterplot
Arguments passed to plot.default
to control
the apperance of the scatterplot (title, points, etc), see
points
for details.
other arguments passed to plot.default
Yihui Xie
The location of the next step is ``current location + random Gaussian numbers'', i.e.,
$$x_{k + 1} = x_{k} + rnorm(1)$$
$$y_{k + 1} = y_{k} + rnorm(1)$$
where (x, y) stands for the location of a point.
Examples at https://yihui.org/animation/example/brownian-motion/