# Testing an implementation of Dupire's local volatility model

I have implemented Dupire's local volatility function $$\sigma(K,T)$$ using call option price time and strike derivatives. $$\sigma(K,T)$$ uses a fixed spot $$S_0$$. The surface $$\sigma(K,T)$$ closely matches the market implied volatility surface $$\sigma_{mkt}(K,T)$$.

I am confused as to how to test the model in a Monte Carlo simulation. Underlier paths would be simulated using

$$S_{t+1} = S_t*\exp((r-0.5*\sigma(S_t,t)^2)dt + \sigma(S_t,t)*\sqrt{dt}*dB_t$$

starting from spot $$S_0$$.

Here $$(K,T)$$ in $$\sigma(K,T)$$ are played by $$(S_t, t)$$.

I need to "match the prices of vanilla options", but what does that mean here? If we concentrate on maturity T, I can compute the MC price of a call struck at K with maturity T as

$$\text{price} = \exp(-R_T T)*\text{average of} \max(0,S_T-K)$$

where the average is over the paths simulated using the GBM with local volatility. If this were repeated for multiple strikes, would the resulting prices be expected to match the prices used to compute the market implied volatilities, for all of the strikes?

when testing that an implementation of a model is correct, you essentially do the same things each time.

1. Check that you reprice your calibration instruments to an acceptable degree of accuracy.
2. If there is(are) an additional effect(s) you have in your model that you are aiming to replicate, check that(those) also.

In the case of your quesiton, and local vol, it's mainly just the first point that applies. And as you ask in your question - yes it is simply a matter of checking that your option prices match the input options.

I would suggest though that you do not trial every option individually, since you can reuse the generated paths for all the options at once, significantly reducing the computational burden...

• "match the prices of vanilla options"
• It means you need to reprice all vanillas with your LV model using monte carlo sims. If all prices are exactly equal to the market prices, your LV model is well calibrated

I think there is a typo in your formula, it should be $$S_{t+1}=S_t\ exp((r-\frac{\sigma(S_t,t)^2}{2})dt+\sigma(S_t,t)\sqrt{dt}N(0,1))$$

• "If this were repeated for multiple strikes, would the resulting prices be expected to match the prices used to compute the market implied volatilities, for all of the strikes?"
• By definition, LV can perfectly fit to all vanillas in the market. For strikes and expiries that are un-observed, it will depend on your in/extrapolation of the implied vol surface