0
$\begingroup$

I am trying to run a Quantlib Python Monte Carlo simulation using either the ql.BlackScholesMertonProcess or the ql.GeneralizedBlackScholesProcess. I have a vol surface that I have generated using ql.BlackVarianceSurface. I am using ql.GaussianMultiPathGenerator as my path generator.
I would like the Monte Carlo process to simply use the implied volatility at the (K, expiry) point of my vol surface when generating the paths, but it seems that it calculates a local vol regardless of the parameters I pass. I believe this to be the case because I get errors of the type: negative local vol^2 at strike 3657.69 and time 0.0119048; the black vol surface is not smooth enough I have tried using:

  1. price_process = ql.BlackScholesMertonProcess(spot_handle,dividendTS=div_and_borrow_curve,riskFreeTS=yield_curve,volTS=volholder.volTS)
  2. price_process = ql.GeneralizedBlackScholesProcess(spot_handle, div_and_borrow_curve, yield_curve,vol_process, ql.LocalVolTermStructureHandle())
  3. price_process = ql.GeneralizedBlackScholesProcess(spot_handle, div_and_borrow_curve, yield_curve,vol_process) 1: calls the BlackScholesMertonProcess, which I believe makes no mention of local volatility in the constructor 2: calls the GeneralizedBlackScholesProcess but passes a dummy local vol: this fails when I got to generate paths: ‘empty Handle cannot be dereferenced’ 3: calls the GeneralizedBlackScholesProcess but doesn’t pass a local vol process

1 & 3 give me the ‘negative local vol^2’ errors and 2 doesn’t generate paths.

Does anyone know how I can call a GaussianMultiPathGenerator that simply uses my vol surface and doesn’t try to generate the paths with a local volatility calculation?

Thank you in advance

$\endgroup$
2
  • 1
    $\begingroup$ This doesn't really make sense to do, from a stochastic calculus point of view. That's probably why it is difficult or impossible to do using QuantLib. If you only care about integrated volatility then you only care about the terminal distribution, in which case numerical quadrature is preferable to Monte Carlo. $\endgroup$
    – Brian B
    Dec 14, 2022 at 20:22
  • $\begingroup$ makes sense, thank you $\endgroup$
    – vman
    Dec 15, 2022 at 16:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.