Skip to content

Use Geometric Brownian motion as a stochastic process to generate sample paths that an underlying asset may follow

Notifications You must be signed in to change notification settings

chenterry85/Geometric-Brownian-Motion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

Geometric Brownian Motion

Geometric Brownian Motion is a stochastic, non-linear process to model asset price. As a rule of thumb , there is an academic paper that stated that GBM works best for forecasting when limited to max 2 week lookahead. The equations is as follows:

$$ \LARGE {dS \over S} = \mu dt + \sigma dW $$

  • $dS$ - Change in asset price over time interval
  • $S$ — Asset price of the previous interval
  • $\mu$ — The drift or the expected return for the time interval
  • $dt$ — The change in time (one interval)
  • $\sigma$ — Volatility term (a measure of spread)
  • $dW$ — Change in Brownian motion term

Use python to generate sample paths for any given asset price

  1. Install Python3.6+
  2. Clone this repository
  3. Provide parameters (initial price, drift, volatility, # generated of paths)
  4. Run python3 simulate.py -i <initial price> -d <drift> -v <volatility> -p <paths> (use --help for more information)

Example

python3 simulate.py -i 400 -d 0.2 -v 0.3 -p 200

drawing

About

Use Geometric Brownian motion as a stochastic process to generate sample paths that an underlying asset may follow

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages