Simulating Geometric Brownian Motion in Python | Stochastic Calculus for Quants

  Рет қаралды 32,725

QuantPy

QuantPy

2 жыл бұрын

In this tutorial we will learn how to simulate a well-known stochastic process called geometric Brownian motion. This code can be found on my website and is implemented in Python. The mathematic notation and explanations are from Steven Shreve's book Stochastic Calculus for Finance II.
We will not be describing or explaining what the stochastic differential equation (SDE) means or how to understand its dynamics using Ito calculus. This will be on the agenda for the following video.
★ ★ Code Available on GitHub ★ ★
GitHub: github.com/TheQuantPy
Specific Tutorial Link: github.com/TheQuantPy/youtube...
★ ★ QuantPy GitHub ★ ★
Collection of resources used on QuantPy KZfaq channel. github.com/thequantpy
★ ★ Discord Community ★ ★
Join a small niche community of like-minded quants on discord. / discord
★ ★ Support our Patreon Community ★ ★
Get access to Jupyter Notebooks that can run in the browser without downloading python.
/ quantpy
★ ★ ThetaData API ★ ★
ThetaData's API provides both realtime and historical options data for end-of-day, and intraday trades and quotes. Use coupon 'QPY1' to receive 20% off on your first month.
www.thetadata.net/
★ ★ Online Quant Tutorials ★ ★
WEBSITE: quantpy.com.au
★ ★ Contact Us ★ ★
EMAIL: pythonforquants@gmail.com
Disclaimer: All ideas, opinions, recommendations and/or forecasts, expressed or implied in this content, are for informational and educational purposes only and should not be construed as financial product advice or an inducement or instruction to invest, trade, and/or speculate in the markets. Any action or refraining from action; investments, trades, and/or speculations made in light of the ideas, opinions, and/or forecasts, expressed or implied in this content, are committed at your own risk an consequence, financial or otherwise. As an affiliate of ThetaData, QuantPy Pty Ltd is compensated for any purchases made through the link provided in this description.

Пікірлер: 19
@rodolfoblasser3329
@rodolfoblasser3329 2 жыл бұрын
Great explanation, greetings from Panama.
@timontimonites6541
@timontimonites6541 2 жыл бұрын
Hi! Amazing content and so insightful! I am curious though! How would you go about making 3 seperate paths with each individual sigma for each path? - Thank you! Got a new subscriber here!
@sunseeker3638
@sunseeker3638 3 ай бұрын
if I pull out one year of historical prices data of a particular stock, how can I estimate the mu and sigma in this case?
@risalandipr
@risalandipr Жыл бұрын
How to get average each point in simulation?
@ibtissamaymen7321
@ibtissamaymen7321 10 ай бұрын
Good content! but I have a question please, i don't see in each step we use Monto Carlo
@crystalwatertherapy
@crystalwatertherapy 8 ай бұрын
you're the best
@doguceteci3682
@doguceteci3682 2 ай бұрын
I have a question, If i want to forecast next 4 days in a stock price should i set my T value as T = 4 or T = 4/252
@killerdiek800
@killerdiek800 11 ай бұрын
Kind of an old video, I know, but why do you use a normal distribution instead of a T-distribution since in other videos you proved that prices aren't normal but have larger tails? Great video, and I thoroughly appreciate someone actually covering quantitative methods for finance.
@surajravindrababu8986
@surajravindrababu8986 3 ай бұрын
I guess it’s a property of the Wiener process that the increment is represented using a Normal distribution.
@thereforetherefore
@thereforetherefore 11 күн бұрын
Ye frr homie🎉
@asabdalwahed1387
@asabdalwahed1387 Жыл бұрын
thank you so much for this explication, but please i have a question : why the deviation in np.random.normal is sprt(dt) ?? the deviation of a brownian motion is dt , right ??
@QuantPy
@QuantPy Жыл бұрын
Of course, check out this video here for detailed explanation kzfaq.info/get/bejne/nK99kqSCx6iznWg.html
@Gerard91999
@Gerard91999 2 жыл бұрын
Nice video! What about lévy processes for Perpetual American Options?
@QuantPy
@QuantPy 2 жыл бұрын
Thanks for the question, yes hopefully we can get into this sort of detail on the channel. Will attempt to walk before we start running though
@andychang1179
@andychang1179 2 жыл бұрын
Good content! I'm wondering why using cumprod instead of cumsum in the implementation? If I remember correctly, the implementation of Brownian motion is using cumsum.
@QuantPy
@QuantPy 2 жыл бұрын
Cumprod in this case because from the SDE each time step we have ratio of Sn+1/Sn = exponential (dynamics). So we multiply the exponential terms to go between time steps. S4/S0 = (S1/S0)*(S2/S1)*(S3/S2)*(S4/S3). Hopefully that example helps it make sense
@tubesteaknyouri
@tubesteaknyouri 6 ай бұрын
As far as I can tell, you can use cumsum with the first equation in the notebook (the stochastic differential equation). I get the same results when I do it that way. Maybe the video creator has an explanation for the relationship. It seems like integration changes the problem to ratios somehow.
@fromzerotospyro
@fromzerotospyro 2 жыл бұрын
how is this different from monte carlo simulation?
@leiwang4502
@leiwang4502 Жыл бұрын
You need to do path simulation first before using monte carlo
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 95 МЛН
Useful gadget for styling hair 🤩💖 #gadgets #hairstyle
00:20
FLIP FLOP Hacks
Рет қаралды 9 МЛН
Clowns abuse children#Short #Officer Rabbit #angel
00:51
兔子警官
Рет қаралды 78 МЛН
Simulating Brownian Motion in Python
13:55
mCoding
Рет қаралды 40 М.
Brownian Motion Share Price Modelling
38:35
Mathematics with Plymouth University
Рет қаралды 9 М.
Monte Carlo Integration In Python For Noobs
15:32
Andrew Dotson
Рет қаралды 150 М.
A Simple Solution for Really Hard Problems: Monte Carlo Simulation
5:58
The experiment that revealed the atomic world: Brownian Motion
12:26
Steve Mould
Рет қаралды 2,5 МЛН
Geometric Brownian Motion SDE -- Monte Carlo Simulation -- Python
26:15
Double Stacked Pizza @Lionfield @ChefRush
00:33
albert_cancook
Рет қаралды 95 МЛН