22

Feb

Brownian motion simulation in R

I have based this post on a very useful piece of code which basically is the core of my own implementation of a Brownian Motion simulation in R. The original reference code

According to Wikipedia the mathematical model for Brownian motion (also known as random walks) can also be used to describe many phenomena as well as the random movements of minute particles, such as stock market fluctuations and the evolution of physical characteristics in the fossil record. The simple form of the mathematical model for Brownian motion has the form:

Where `e`

is drawn from a probability distribution.

Example of running:

`> source("brownian.motion.R")`

`> brownian(500)`

You can download the code here

Tags: R, Simulations