The Brownian motion is certainly the most famous stochastic process (a random variable evolving in the time). It has been the first way to model a stock option price (Louis Bachelier's thesis in 1900).


The reason why is easy to understand, a Brownian motion is graphically very similar to the historical price of a stock option.
A Brownian motion generated with R (n = 1000)


The historical price of the index FTSE MID 250, source Yahoo Finance.



Even though it is not any more considered as the real distribution of stock options, it is still used in finance and methods to simulate a Brownian motion are really useful. As you will see the code is strikingly easy. We have used the Donsker's principle.

If Y(i) is a serie of k variables normally distributed, then we can  create X(i) = (Y(1) + ... + Y(i))sqrt(i/k). Then X(i) is a proxy of the Brownian motion.

The code (R) : 

size = 1000
y = rnorm(size)
x = y

for (i in 1:size){
  x[i] = 1/sqrt(size)*(sum(y[1:i])*sqrt(i))
}

plot(x, type = 'l', xlab = 'Time', ylab = 'Profit')
1

View comments

Pricing of a financial product : A pricer of a call option.
Temporal network model - Barabási-Albert model with the library igraph
3
How to plot a network (package network) - Tip 2
1
Have you tried to understand your network? - Random generation of network models
Function apply() - Tip 1
1
Want to win "Guess who?" - Have an institutional neural network approach
How to choose your next holidays destination - Uniform distribution on a sphere
4
Generation of a normal distribution from "scratch" - The box-muller method
Generate stock option prices - How to simulate a Brownian motion
1
The consequence of merging insurance companies - Risk simulation and probability of ruin
Estimation of the number PI - A Monte Carlo simulation
The movement of a drunk guy - Random Walk and exponential regression
How does my computer know what language I am using? – An approach of statistical learning (Language, Computer Science)
How does my computer know what language I am using? – An approach of statistical learning (Language, Computer Science)
The fear-index: is the VIX efficient to be warned about high volatility? (Finance & Systematic Processus)
Who is the most complete athlete? – An insight with the Mahalanobis distance (sport & data analysis)
Who is the most complete athlete? – An insight with the Mahalanobis distance (sport & data analysis)
ProbaPerception: Introduction
Blog Archive
Translate
Translate
Loading