Data Scientist - Benjamin Tovar

Brownian motion simulation in R

22

Feb

 

Brownian motion simulation in R

Introduction

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

Methods

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:

eq

Where e is drawn from a probability distribution.

Results

Example of running:
> source("brownian.motion.R")
> brownian(500)

bm2

Code

You can download the code here

 

twittergoogle_plusredditlinkedin

Tags: ,


Leave a comment
 

Your email address will not be published. Required fields are marked. *