Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

GBM Asset Price Simulator

An interactive simulator for asset price paths based on Geometric Brownian Motion (GBM), built in Python. Parameters are estimated from historical data via Yahoo Finance.

What it does

The model simulates a large number of possible future price paths for any publicly traded asset. At each time step, the price evolves according to: S(t + dt) = S(t) * exp((μ - σ²/2) * dt + σ * √dt * Z)

where Z ~ N(0,1). The term σ²/2 ensures that the simulated process has expected return exactly equal to μ, accounting for the difference between arithmetic and geometric compounding.

mu and sigma are estimated from 10 years of historical log-returns and used as default values, but can be adjusted interactively.

Output

  • Left panel: simulated price paths over the selected horizon
  • Right panel: distribution of terminal prices across all scenarios

Parameters

Parameter Description Default
ticker Yahoo Finance ticker symbol user input
n_years Simulation horizon (years) 10
n_scenarios Number of simulated paths 100
mu Annualized expected return estimated from data
sigma Annualized volatility estimated from data
equity Starting price last closing price

Requirements

pip install pandas numpy matplotlib yfinance ipywidgets

Run in a Jupyter notebook or JupyterLab environment.

About

Interactive GBM asset price simulator with parameter estimation from historical data

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages