Тёмный

Heston Model Calibration in the "Real" World with Python - S&P500 Index Options 

QuantPy
Подписаться 73 тыс.
Просмотров 24 тыс.
50% 1

The Heston model is a useful model for simulating stochastic volatility and its effect on the potential paths an asset can take over the life of an option. It's popular because of:
- easy closed-form solution for European option pricing
- no risk of negative variances
- incorporation of leverage effect
This allows for more effective modeling than the Black-Scholes formula allows due to its restrictive assumption of constant volatility.
One of the nice things about the Heston model for European option prices is that there is a semi-analytical closed-form solution once you have the characteristic function. In this video we will go through the mathematics of the characteristic funciton for European Option prices, implement this numerical integration in python and then calibrate the model to real world index option prices.
We will be using the S&P500 Index Options to calibrate the risk-neutral Heston Model. As a stochastic volatility model, the heston model can incorporate the real-world volatility smile within it's pricing dynamics.
Here I have drawn on a number of academic papers/online resources for reference:
- Heston Girsanov's Formula: quant.stackexchange.com/quest...
- Heston PDE : uwspace.uwaterloo.ca/bitstrea...
- Heston Characteristic Eq :www.maths.univ-evry.fr/pages_...
- Heston Implementation : hal.sorbonne-universite.fr/ha...
- Heston Calibration : / build-the-heston-model...
★ ★ Code Available on GitHub ★ ★
GitHub: github.com/TheQuantPy
Specific Tutorial Link: github.com/TheQuantPy/youtube...
00:00 Intro
00:45 The Mathematics Explained
09:05 Python Implementation of Semi-Analytical Solution
14:00 Real World Data - Options & Yield Curve
19:50 Heston Model Calibration
★ ★ QuantPy GitHub ★ ★
Collection of resources used on QuantPy RU-vid 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.

Опубликовано:

 

22 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 45   
@derekwu210
@derekwu210 2 года назад
I'll be doing SOA (Society of Actuary)'s QFI Quantitative Finance exam in a few weeks. this video connected the dots for me. Thanks so much!
@qiguosun129
@qiguosun129 6 месяцев назад
This lecture is really deep but intuitive. If I write a research paper, it will be pleasure to cite your work.
@anetesperon4526
@anetesperon4526 2 года назад
This was amazing!! Could you go over how Heston model calibration for American options would look like, but with JUMPS added to the model, please?
@ramonaalexandra1994
@ramonaalexandra1994 2 года назад
Amazing! thank you so much!
@Med.El-amine
@Med.El-amine Год назад
You are amazing and exceptional ❤🎉
@mohamadghrayeb6923
@mohamadghrayeb6923 2 года назад
A bates extension on this would be amazing and a bit easy since it only adds the jump component!
@annami797
@annami797 Год назад
Great topic, thank you! Could you describe the dataset you had. Did you have a historical data (if yes how long) or just actual prices with maturities?
@fritmore
@fritmore 8 месяцев назад
great walkthrough ur code thx but still waiting for the AMERICAN Heston model!!!
@baijuthomas3716
@baijuthomas3716 2 года назад
Could you compare the Heston vs the Bachelier model at some point because it sounds like the Pros (aside from the Brownian vs random process between them) of Heston is similar to Bach so trying to understand the use case for model selection here, do you select the model based on the properties of the underlying instrument. Thanks.
@junhuiwoo8966
@junhuiwoo8966 2 года назад
what a great video so useful to me thanks. Can you give me a lecture on SABR model ?
@raki7881
@raki7881 4 месяца назад
thanks. Great informative video. what changes if instead of calls if need to calibrate for put prices?
@mountaindrew_
@mountaindrew_ Год назад
Hello! Are you assuming the pure expectations hypothesis at 15:15 when you say you want to use the present term structure to discount at risk free?
@houssamabella263
@houssamabella263 Год назад
thank you so much this video help me
@MLAlgoTrader
@MLAlgoTrader 22 дня назад
This is great! For illiquid options using the midpoint might not be ideal since it is often very off from the fill you can get in practice. What thoughts do you have on handling this? I know you can weight point by "liquidity" like volume/open interest/tightness of bid-ask spread as you mention, but was just wondering how you would go about calibrating a pretty illiquid contract where many midpoints aren't really the "market" price
@bryan-9742
@bryan-9742 2 года назад
This is great
@ZEU666
@ZEU666 9 месяцев назад
In the parameters, how can we set a proper x0 for each of the parameters?
@bachpham5357
@bachpham5357 Год назад
Can you do the same for Double Heston Model ?
@dc4608-q
@dc4608-q 2 дня назад
Thank you for the video! But could you please explain why when I run the monte carlo simulation of heston model with codes from your last video with the same parameters, the result doesn't match?
@user-lj8mf1tu6v
@user-lj8mf1tu6v 3 месяца назад
Hi I'm not understand about what you mention, bj can combine to b and uj can combine to u, can you explain more further in detail, thank you!
@dodge7750
@dodge7750 Год назад
Thank u can you do the same with Excell data,please?
@ekiller1103
@ekiller1103 Год назад
How can I apply this having yahoo finance as a parameter?
@calvinyao1424
@calvinyao1424 Год назад
Awesome video! I am doing a course project on this topic. Somehow I could not get to the same integrand as yours. Mine is the same as the one shown in the paper Not-so-complex logarithms in the Heston model. How did you remove the discount factor from the second part of the integrand? Also the entry before the first part that I got is e^{-r*\tau}.
@ohotnik_na_shalavvvvv4223
@ohotnik_na_shalavvvvv4223 Год назад
I got the same thing. do you understand how did he remove the discount factor from the second part of the integrand?
@chaozhou3777
@chaozhou3777 2 месяца назад
Tried to run the Jupyter Notebook but EOD returned error message: "Only EOD data allowed for free users. Please, contact our support team"
@armandcharlesngabirano3795
@armandcharlesngabirano3795 2 года назад
I have a very important question: when the rates are negative like in Europe; can the Heston model help in pricing a European type of options?
@QuantPy
@QuantPy 2 года назад
The blackscholes or Heston model does not make the assumption of positive interest rates r > 0. So you can definitely use negative interest rates, just be aware your borrowing rate is likely different from your lending rate
@chymoney1
@chymoney1 2 года назад
How does the Heston model actually play out when used for options trading? I think it is certainly beautiful as a math person, but I have heard many say the fine-tuning of the hyper parameters make the Heston model rather cumbersome to use in practice, so many just stick with Black-Scholes, or a modified Black-Scholes or use local volatility model. Also I have wondered since we are calibrating the Heston model from a price surface which was calculated from the Black-Scholes model, how can it be a better predictor? These are just some naive questions as a beginner quant. Great video thank you for your time.
@michelebellipanni2373
@michelebellipanni2373 2 года назад
It is not a problem of prediction. The sense of using option volatility quotes to get prices with black & scholes is to consistently calibrate a model (Heston, Variance gamma, etc.) to the market. Obviously none of us will price a derivative instrument better than the market does (the investment Banks models used for this purpose are very sophisticated), so your goal is to build a model that is consistent with the market for pricing new derivatives for your bank's client , which are not listed in a ordinary market.
@chymoney1
@chymoney1 2 года назад
@@michelebellipanni2373 If I understood correctly; you’re saying it is pointless to use Heston to for vanilla options and only useful for exotic options.
@michelebellipanni2373
@michelebellipanni2373 2 года назад
If the vanilla instruments you are talking about are quoted, you'll use the realized implied- volatility and the Black & Scholes formula because it's a closed form and It works Faster (time in finance Is a very importante asset) . Heston is an amazing mathematical model and gives US much more than just a price. But obviously in all these discourses it is necessary (also in the construction of stochastic models) take a position .Let's say that the use of Heston could be convenient but It depend on the purpose. (Trading, Hedging,build new instruments,ecc..) I don't know if I have explained myself well, I am an Italian student and I do my best with English.
@chymoney1
@chymoney1 2 года назад
@@michelebellipanni2373 Your English is great and thanks that makes sense.
@atreyadas4453
@atreyadas4453 2 года назад
What is the unit for Kappa in the Heston Model?
@QuantPy
@QuantPy 2 года назад
variance is unitless, and so is kappa
@lightningblade9347
@lightningblade9347 2 года назад
Thank you so much for the tutorial! I have a question if you don't mind: Can the data you used be found free in yahoo finance?
@QuantPy
@QuantPy 2 года назад
Options data can be tricky, but if you find a free resource feel free to use the data of course
@sewliboral1400
@sewliboral1400 Год назад
@@QuantPy Where can i find the data from free resource
@user-pi9bp8ji1t
@user-pi9bp8ji1t 8 месяцев назад
Awesome video, but I noticed there is a mistake in one integral form, the e^rt should be e^-rt and placed before integral.
@QuantPy
@QuantPy 8 месяцев назад
Thanks for watching, I’ve double checked the calcs, looks ok to me - can’t tell what you mean. But if you still think there’s an error, tell me which line you think should be changed: quantpy.com.au/stochastic-volatility-models/heston-model-calibration-to-option-prices/ Thanks
@user-pi9bp8ji1t
@user-pi9bp8ji1t 8 месяцев назад
@@QuantPy I think one integral formula should be changed to '$\large C(S_0, K, v_0, \tau) = \frac{1}{2}(S_0 - Ke^{-r \tau}) + \frac{1}{\pi} \int^\inf_0 \Re [ e^{-r\tau} (\frac{\varphi(\phi-i)}{i\phi K^{i\phi}} - K\frac{\varphi(\phi)}{i\phi K^{i\phi}} )] d\phi$'. I have double checked this formula with two integral form.
@user-pi9bp8ji1t
@user-pi9bp8ji1t 8 месяцев назад
@@QuantPy And I have another question, some books and papers just set lambda equal to zero,but Heston original paper and your videos don't,could you explain what is the difference?
@QuantPy
@QuantPy 8 месяцев назад
In the real world the market price of risk needs to be accounted for. There will nearly always be a difference between risk neutral value and the premium you have to pay in the market place for purchasing this product/hedge ect.
@user-pi9bp8ji1t
@user-pi9bp8ji1t 8 месяцев назад
@@QuantPy So in general, I can just set lambda to be zero when I use Heston model
@aymaneleboss
@aymaneleboss Год назад
10:22 I do think it's Real(exp(-r*tau .... and not Real(exp(r*tau... We divide by phi(-i) which is E(exp(x)) under the risk neutral measure which is S0 *exp(r*tau)
@DeejayGabin
@DeejayGabin Год назад
Easier to read rates using pandas.read_csv using the link to download CSV file
@aarondelarosa3146
@aarondelarosa3146 10 месяцев назад
Hello Jonathan. I'm facing serious issues to replicate your code. Specially those related to download data from EodHistoricalData using my API. I can't download Options Data. Can I send you the code by email, so you can fix it?
Далее
D3 BMW XM LABEL Король.
31:52
Просмотров 715 тыс.
НОВАЯ ПАСХАЛКА В ЯНДЕКСЕ
00:20
Просмотров 927 тыс.
Heston model explained: stochastic volatility (Excel)
14:55
Black-Scholes Implementation in Python
9:39
Просмотров 29 тыс.
The Truth About Learning Python in 2024
9:38
Просмотров 155 тыс.
6. Monte Carlo Simulation
50:05
Просмотров 2 млн
Black-Scholes in Python: Option Pricing Made Easy
12:22
D3 BMW XM LABEL Король.
31:52
Просмотров 715 тыс.