|
From: Klaus S. <kl...@sp...> - 2019-12-31 15:34:09
|
Hi Alex, without seeing the example code it is difficult to spot the exact problem. The Dupire formula is notorously cumbersome and the PDE solver is prone to numerical problems if e.g. the input surface is not arbitrage free. Did you use an illigalLocalVolOverwrite? What happens if you increase the lattice size? regards Klaus On Montag, 30. Dezember 2019 21:13:41 CET Alex Winter wrote: Hi guys, I spent some time recently testing the local volatility implementation in QuantLib and have a couple of questions I was hoping someone might be able to give me a hand with. In order to test the local vol model I'm trying to reprice a grid of EURUSD FX options. My only other inputs are foreign and domestic yield curves. I interpolate between grid points to produce an implied vol surface, represented in QuantLib by some variety of the BlackVolTermStructure class. I compute the local vol surface from the implied vol surface using the LocalVolSurface class. This implements a version of the Dupire formula adapted to implied vols rather than option prices (see Section 2.3 of the Gatheral's notes here http://web.math.ku.dk/~rolf/teaching/ctff03/Gatheral.1.pdf). The surface looks reasonable when plotted. I pass the implied and local vol surfaces as inputs to a GeneralizedBlackScholesProcess. Next I try to price an option using the FdBlackScholesVanillaEngine. I set the localVol flag to true. This ensures that the volatility used in the finite difference operator (see FdmBlackScholesOp) is sampled from the local vol surface supplied via the input GeneralizedBlackScholesProcess. If the localVol flag is set to false then the volatility is instead sampled at each time step from the supplied BlackVolTermStructure (at the strike level of the option), and so a sort of volatility term-structure model is presumably implemented. I compare the results against those obtained using a flat volatility term structure, at the level of the market observed implied volatility of the particular option being priced. I'm a little puzzled by the results. I'm able to reproduce the market implied vols using the flat term structure model (by construction), but not using the local volatility model. What's confusing me most is that the prices obtained using the local vol model aren't complete nonsense, but seem to converge (as the FD mesh is refined) to the results obtained when the localVol flag is set to false. Has any one noticed similar behaviour before? Am I perhaps misinterpreting the BlackVolTermStructure that needs to be passed to the FdBlackScholesVanillaEngine. Many thanks, Alex Winter |