Solving the Fokker-Planck equation via finite difference methods is not the only way to calibrate the Heston stochastic local volatility model
The basic equation to calibrate the leverage function for a local volatility surface
and a set of Heston parameters
is given by
Key problem here is to calculate the expectation value . This can either be done via the Fokker-Planck equation as outlined in [3] and the references in there or via Monte-Carlo simulations as shown in [2]. Getting the solution of the Fokker-Planck equation via finite difference methods is anything but easy if the Feller constraint is violated. In this case the Monte-Carlo approach promises less numerical problems to overcome. Starting point for an efficient Monte-Carlo calibration is a fast and accurate simulation scheme for a stochastic local volatility (SLV) model. The variance part of the SLV can be sampled exactly using the non-central
distribution.
The boost library supports the inverse of the cumulated non-central distribution but the calculation itself is rather slow. The Heston QE scheme outlined in [1] comes with an fast and accurate sampling scheme for the square root process. In the case
it reads
The authors in [2] suggesting a sampling scheme for . The scheme below is a bit closer to the original QE scheme and without a rigorous proof it has shown slightly smaller discretisation errors for the examples.
To get from the Monte-Carlo paths to the leverage function the authors in [2] using a binning technique in every time step. QuantLib supports two ways to generate the random draws, either based on i.i.d normal variables or based on Sobol quasi Monte-Carlo simulations with brownian bridges.
Test case definition: Feller constraint is violated.
Effectively the leverage function will remove the skew and term structure introduced by the Heston model and shifts volatility to 30%. In order to measure the calibration quality the price mismatches expressed in volatility basis point differences are calculated for OTM calls and puts with prices above 0.02 and for maturity from one month until two year. The SLV prices are calculated by solving the Feynman-Kac backward equation using finite difference methods.
The diagram above shows the average pricing error for different number of Monte-Carlo calibration paths and for different bin sizes. As expected the optimal bin size depends on the number of Monte-Carlo simulations. Especially deep OTM options benefit from a large number of bins. The usage of Sobol quasi Monte-Carlo simulations with brownian bridges does not give a significant advantage.
The average pricing error is decreasing with the square root of the number of Monte-Carlo calibration paths if one always choses the optimal bin size as shown in the diagram below. Quasi Mont-Carlo path generation with brownian bridges gives a small advanage.
As expected the leverage function itself exposes some Monte-Carlo noise, see diagram below. The corresponding leverage function based on the finite difference method is smooth but the overall calibration error is of the same size.
The calibration for different mixing factors is straight forward. The diagram below e.g. shows the prices of a double no touch option for different distances of the (symemtric) lower and upper barriers expressed in terms of the corresponding Black-Scholes prices. This diagram type is derived from figure 8.8 in [4].
The source code is available on github as part of the test suite HestonSLVModelTest.
[1] Leif Andersen, Efficient Simulation of the Heston Stochastic Volatility Model
[2] Anthonie Van der Stoep, Lech Grzelak, Cornelis Oosterlee,
The Heston Stochastic-Local Volatility Model: Efficient Monte Carlo Simulation
[3] Johannes Goettker-Schnetmann, Klaus Spanderen, Calibrating the Heston Stochastic Local Volatility Model using the Fokker-Planck Equation
[4] Iain J. Clark, Foreign Exchange Option Pricing: A Practitioner’s Guide
Great! Thank you very much. I am asking one more time regarding forward smiles LSV vs LV. Due to the Mimicking Theorem shouldn’t all future transition probabilities be equal in LV and LSV model? If all transition probabilities (including future ones) are equal for LV and LSV model, shouldn’t then forward smiles be equal of LV and LSV Independent of mixing fraction? I guess I am still missing the point.
Transition probabilities of LV and LSV are of course only equal when the varianse is integrated out for the LSV one.
I think the future transition probabilities \gamma(x_1, t_1, x_2, t_2) are not necessarily the same even if the terminal distribution \gamma(x_1=x_0, t_1=0, x, t) is given by the implied volatility surface, which is reproduced by both models. Different propagators \gamma(x_1, t_1, x_2, t_2) lead to different forward skews and different prices.
The terminal distribution \gamma(x_1=x_0, t_1=0, x, t) is equal of LV and LSV model at all times, not only at the times where vanilla prices are given, right? For each pair, (S_t, t), the probability density of LV model: p(S_t,t) equals the one of LSV model :Integral p(S_t,t,v_t) dv_t. If this is true for all (S_t, t), I wonder how the future transition probabilities can be different. In my MC simulations, LV and LSV Forward smiles conditional on S_t = x are also equal. Is my mistake maybe that I interpolate the local vol Surface for each Point (S_t,t) to calculate the local volatility correction at each pont L(S_t,t) no matter which Point S(S_t,t) is given in the MC simulation?
I fully agree, the terminal distribution \gamma(x_1=x_0, t_1=0, x, t) is equal for LV and LSV for all {x, t} . But from this IMO we can not infer that the propagator \gamma(x_1, t_1, x_2, t_2) is the same for all {x_1, t_1, x_2, t_2}.
Based on the test case described above I’ve written a small Monte-Carlo simulation to calculate the forward implied volatility for an option starting in one year from today and with maturity in two years time. The source code is available on github, repository https://github.com/jschnetm/quantlib/tree/slv, test case HestonSLVModel::testForwardSkew(). Even though the local volatility is constant everywhere (30%) the LSV model exhibits a skew for forward starting options if \eta is greater than zero. Please find the corresponding diagram here https://hpcquantlib.files.wordpress.com/2016/01/forwardskew.png .
Shall we compare the leverage functions e.g. for the test case in the blog entry in order to find the differences in the implementations?
You are right, I found a mistake and now get similar results like you. It also makes sense to me now from a conceptional point of view, I believe. I would appreciate if you let me know if the following makes sense to you: I analyse forward smiles, conditional on spot being at a certain level at the forward time T1 for options expiring at T2. So I don’t look at average smiles for certain level of moneyness like you did. For the SV model, the uncertainty about the instantaneous volatility at T1 increases with higher forward times T1. As ITM and OTM options have positive vomma, they are convext in implied volatility which is an approximation of avarage instantaneous volatility. Jensen’s inequality -> ITM and OTM Options have higher implied volatility than the average of instantaneous volatility. This makes the forward smile for SV models more convex the higher the forward time T1, as the uncertainty about instantaneous volatility increases. For the SLV model, the expectation of instantaneous variance is equal to the LV model. However, there is still stochasticity in the instantaneous variance. This makes Jensen’s inequality work again, and thus adds convexity to the Forward smiles the higher the forward time T1. What I don’t understand then is however, why you get lower implied vols for higher strikes and higher implied vols for lower strike in your graph https://hpcquantlib.files.wordpress.com/2016/01/forwardskew.png . Shouldn’t the smile be rather symmetric? Thank you very much for giving me insides during the last few weeks, you helped me very much in understanding these topics.
I think the shape of the skew/smile of the LSV model is given by the Heston model parameters, e.g. if I use different correlations for the Heston model I get a forward smile (\rho=0.0) or left/right forward skew, please see https://hpcquantlib.files.wordpress.com/2016/01/forwardskewrho.png. Unfortunately I don’t have a short descriptive explanation for it other than that the local volatility forward skew flattens out and the forward skew/smile is dominated by the underlying Heston model parameters after some time.
Okay, thank you very much
I think I finally found an intuitive reasoning for it. The “Mimicking” or Gyöngy’s Theorem only holds for the expectation at t = 0 but not for the conditional expectation given a certain spot level in the future, i.e. not on each simulated path. This mean it holds for the expectation of variance at a certain point S_t and t over all possible paths but does not hold for any given path as soon as t > 0 and conditional on the spot level given by that path. For non path dependent options, this is sufficient to result in equal smiles, but not for path dependent options. This is because path dependent options have an expected payoff equal to the average of payoffs resulting from each path, and not the payoff resulting from the path that used the average variance.
Where can I find the code for this?
Code is in QuantLib since release 1.8. Good starting points are the test cases HestonSLVModelTest::testMonteCarloCalibration and HestonSLVModelTest::testMoustacheGraph.
Has the source code been removed from Github for HestonSLVModelTest?
All code has been moved to the official QuantLib repository, please see
https://github.com/lballabio/QuantLib/blob/master/test-suite/hestonslvmodel.cpp
Thanks for the hint, I’ve change the link in the blog entry.