Robert Brown and Pollen Particles

March 15, 2010

[This article was first published on stotastic » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

In 1827, the botanist Robert Brown was studying pollen particles as they floated in water. When viewed through a microscope, he observed that the particles seemed to move around as if the were alive. Although he couldn’t have known at the time, the seemingly random motion was caused by the collision of water molecules against the pollen particle. Later on, the random motion he observed would be given the name ‘Brownian Motion’.

Simulating Brownian Motion

We can model what Brown may have seen by simulating a two dimensional Brownian Motion. Executing the following code in R will produce a chart as if we had recorded the location of the pollen particle every minute (or some other arbitrary time interval) and connected the points in sequence.

n <- 100
y <- rep(0,n)
x <- rep(0,n)
for(i in 2:n){
  y[i] <- y[i-1] + rnorm(1,0,1)
  x[i] <- x[i-1] + rnorm(1,0,1)
plot(x,y, type="l", col="blue", ylim=c(-10,10), xlim=c(-10,10))

To leave a comment for the author, please follow the link and comment on their blog: stotastic » R. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: ,

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)