a reproducible gallery of statistical graphics
We can use the animation package to produce animations in R.
This short article shows you how to create a Brownian motion with the brownian.motion()
function.
Simply speaking, a Brownian motion shows the trace of the coordinates
where $\epsilon_i$ is i.i.d from a standard Normal distribution. That is fairly easy to program in
R – it is nothing but cumsum(rnorm(n))
, and that is what brownian.motion()
does internally.
Done.