Skip to content
This repository was archived by the owner on Sep 6, 2019. It is now read-only.

Commit 2d92304

Browse files
committed
improve brownian motion example
1 parent f03d995 commit 2d92304

File tree

2 files changed

+53
-3
lines changed

2 files changed

+53
-3
lines changed

doc/process.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,22 @@ $\sigma(t_0, \mathbf{x}_0)^2 \Delta t$
4646
Model a Geometric Brownian Motion, governed by the stochastic differential equation:
4747
$dS(t, S) = \mu S dt + \sigma S dW_t$
4848

49-
Example to simulate a series of prices from a Geometric Brownian Motion
49+
####Example
50+
To simulate a series of prices from a Geometric Brownian Motion:
5051

5152
```julia
5253
using Distributions
5354
bm=Ito.Process.GeometricBrownianMotion(100, .1, .2)
5455
t=0; x=bm.start; dt=.001
55-
W=Normal(0, dt)
56-
for i=1:100000
56+
W=Normal(0, 1)
57+
for i=1:1000
5758
t=t+dt
5859
x=Ito.Process.evolve(bm, t, x, dt, rand(W))
5960
end
6061

6162
```
63+
This will produce a price process looking like this (Charts by [Gadfly](http://dcjones.github.com/Gadfly.jl/doc/))
64+
![Prices] (res/gbm.svg)
6265

6366

6467
###Generic Black Scholes Process

doc/res/gbm.svg

+47
Loading

0 commit comments

Comments
 (0)