enricoschumann / NMOF

Functions, examples and data from the first and the second edition of "Numerical Methods and Optimization in Finance" by M. Gilli, D. Maringer and E. Schumann (2019, ISBN:978-0128150658). This repository mirrors https://gitlab.com/NMOF/NMOF .
http://enricoschumann.net/NMOF
Other
34 stars 6 forks source link

Heston Inputs #1

Open SatoshiReport opened 4 years ago

SatoshiReport commented 4 years ago

Are there any examples of computing the option price using the Heston model? I understand there are values to be plugged in but how are some of the values computed from the underlying's price?

For example, how does current and long-run variance differ? Number of days of prices looked at to compute variance? Should it be based off of the price or the log price or the diff of the log price?

For computation of rho - is this a correlation between two vectors? Or just spot vs the one value of variance?

Is variance assumed to be annual?

How does one compute the speed of mean-reversion? How historical should this be?

And for volatility of variance - is this just standard deviation or is variance an array which then standard deviation is then calculated off of?

Thanks for a great package and any help you can give.

enricoschumann commented 4 years ago

The model parameters are usually not computed from the time-series of the underlier, but are instead recovered from the prices of options. Essentially, you choose parameters in such a way that the model prices match observed option prices. Such a calibration is described for instance in https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1566975 , or in chapter 17 of the NMOF book. So the quality of the parameters is no judged by how well they match the actual time-series of the underlier, but by how well the theoretical prices that the model produces match actual option prices.

I will see whether I can to the documentation on what effect the different parameters have on the produced option prices (more specifically, on the shape of the implied vol surface of those option prices).

SatoshiReport commented 4 years ago

Thanks for your reply. I don't understand the underlying concept however. Why not just use the option price in the market and call it a day? That has the best fit. In which case why have a model? The point of a model is because one is looking for something more accurate than the market price and are looking for mis-pricings.

Or perhaps you need to fit the volatility curve for the given security and expiration date. Once I get this to work why not just use a simple curve fitting algo on the volatility curve and price from there. Isn't that what the Heston model would be doing anyway?

If I get something working I am happy to post it here.

SatoshiReport commented 4 years ago

OK got it working and the results look good. Thanks for making this code public domain. I will need to purchase your book now so I understand it more.

enricoschumann commented 4 years ago

I am glad that it worked.

I hope we agree that your questions are not really about the NMOF package, but about modelling.

The most important question is: why are you interested in the Heston model? What do you want to do with it? Because this decides how you would calibrate the model, or if you will want to use it at all.

When people calibrate the model as I described, they probably want to use it to price other options (in particular, exotics). They will not use the model to "reprice" the options on which it was calibrated.

But you are not forced to use Heston or any specific model. In practice many people do exactly what you describe: they directly model the Black--Scholes implied volatility. In the academic literature, this is rarely done[*], because it is not really "clean": essentially, you model the same underlier, but with different parameters. But if it works for you, all is well.

Btw, If you want to the calibrate a whole surface, I'd suggest to not use callHestoncf but to write a pricing function that prices the whole surface at once (as we did in https://papers.ssrn.com/sol3/papers.cfm?abstract_id=1566975 ; there are some sketches on how to implement this in R in the NMOF manual http://enricoschumann.net/NMOF.htm#NMOFmanual )

[*] Here is one counterexample:

@ARTICLE{Christoffersen2004,
  author       = {Peter F. Christoffersen and Kris Jacobs},
  title        = {The Importance of the Loss Function in Option Valuation},
  journal      = {Journal of Financial Economics},
  year         = 2004,
  volume       = 72,
  pages        = {291--318},
  number       = 2
}