This might be silly, but I’m seeking to use QuantLib to price vanilla American call and put options using a Black-Scholes-Merton process and the Monte Carlo pricing engine based on the Longstaff Schwartz algorithm.

My question is: Am I confined to Gaussian pseudorandom numbers in this engine? Or can I use pseudo RNs drawn from some other underlying distribution, like Student T, or some other distribution I can generate via the inverse CDF?

Put another way, how do I define a pricing engine for American call and put options that uses random numbers drawn from a student t (or custom) distribution based on mcamericanengine.hpp in QuantLib?

I recognize that I may only have the volatility parameter to modify the shape of my distribution. After investigating the Monte Carlo framework in Quantlib and reading over chapter 6 of “Implementing QuantLib”, here’s what I think I need to do:

• Define a distribution function (mydistribution.cpp and mydistribution.hpp) in math/distributions with a InverseCumulativeMyDistribution class

• Instantiate a class template in rngtraits.hpp

• Define a new SingleVariate traits class in mctraits.hpp

• Define (I think) a MonteCarloModel as in montecarlomodel.hpp

• Do I need to make changes to mcsimulation.hpp, mclongstaffschwartzengine.hpp, and mcamericanengine.hpp as well?

Am I on the right track here? Please pardon my ignorance on this framework as I’m very new to both QuantLib and cpp programming. If by some miracle I get this working, how do I take the extra step and expose this new pricing engine in python via QuantLib-SWIG? I’m willing to put in the work! For reference I have vs 1.25 of QuantLib and QuantLib-Python installed on Windows 10 and confirmed both are working.

  • $\begingroup$ If the (pseudo) random numbers you use inside the montecarlo are not normal (in their moments) then you will introduce a systematic bias to the generated paths. If you are going to try running custom montecarlo engines where you adjust how they work internally, then really you need to be calibrating with these same engines and your problem starts to become quite complicated. $\endgroup$
    – will
    Jul 5 at 1:49
  • $\begingroup$ I am not an expert on Quantlib, however, regarding your question concerning a different Monte Carlo engine, this should not be a problem. In principle, the L&S algorithm and the payoff are not directly dependent on the distribution of the underlying. However, if a transformation is used that is based on a Gaussian assumption, then your approximations can be off when a different distribution is used. My advice would be to first try a MC engine for jump-processes and compute call options (without dividends) as the analytical solution for this is known. Then you have a reference to compare to. $\endgroup$
    – rrnl
    Jul 5 at 8:51
  • $\begingroup$ If you have the book Paul Glasserman. Monte Carlo methods in financial engineering - look in section 8.5 Stochastic Mesh Methods - An Interleaving Estimator - for some Longstaff and Schwartz discussion that may help you - and in section 9.3 A Heavy-Tailed Setting. $\endgroup$ Jul 6 at 2:12
  • $\begingroup$ Thanks for your comments and suggestions! Re. a systematic bias to generated paths, I completely agree and need to look out/account by perhaps using mean-centered returns. I also now appreciate (after the fact) that I have a calibration problem here. To that end I think I need to implement a CalibratedModel, and perhaps and CalibrationHelper (still learning the ins & outs of QuantLib). In any case, should I get this working, then comparing to results generated with a VG process is another good idea. $\endgroup$ Jul 7 at 23:19
  • $\begingroup$ Follow-up: It turns out I had an electronic copy the MC methods in FE, but hadn’t read it! Like my mentor used to say: “Months in the lab can save you minutes in the library!” FWIW, my motivation here can be traced to a comment made by Vineer Bhansali in his book “Tail Risk Hedging”, where he suggests replacing sample paths from a normal distribution with those from “fatter-tailed parametric distributions” (pgs 125-6)). There’s also this blog post: mathworks.com/help/finance/… $\endgroup$ Jul 7 at 23:26


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.