Posted by
Ferdinando M. Ametrano-3 on
URL: http://quantlib.414.s1.nabble.com/Multi-asset-options-tp2771p2782.html
Hi Wujiang
> The benefit of a more sophisticated Payoff class is that it allows
> pricing to
>be decomposed into modeling phase and computing phase. By modeling I mean the
>things quant does to arrive at model dynamics (SDE) and economics (cashflow,
>payoff etc.) while computing is simply a numerical/analytical procedure to
>solve the SDE, whether closed form, finite difference, MC, lattice, etc.
In QuantLib this is achieved using StochasticProcess and DiffusionProcess
for the modelling phase, Instruments for the economics, and PricingEngine
for the numerical/analytical procedures.
> The real advantage of such a separation is, as soon as you've arrived
> your
>SDE and payoffs, existing solutions / tools may be reused to compute it.
Indeed this is the major reason behind the new
Instrument/StochasticProcess/PricingEngine framework. In this framework the
Payoff class is just a terminal/boundary condition provided by the
Instrument and used by the PricingEngine.
>Black-Scholes formula for example can be used without modification and you
>don't need to write a AsianOptionBlackScholesPricer. In fact, all your 1-D
>trees, 1-D finite differences work as well, in a similar manner to
>plug-n-play.
>With this design I can see the number of Pricers in quantlib can be
>significantly reduced without lossing any pricing capability. (That was the
>exact reason I came across this design in my earlier job. Jus t name this:
>OptBSPricer, OptBinTreePricer, OptFDPricer; QuantoBSPricer,
>QuantoBinTreePricer, QuantoFDPricer; ... repeat that list with CompositeOpt,
>FuturesOpt, DigitalOpt, ... Eventually the list of pricers grows
>unmanageably.)
> I think we're already seeing the list grow a lot in QuantLib. May be
> a good
>time to revisit it a little bit.
My impression is that you're referring to the old QuantLib Pricer
framework. This problem has been solved in the new framework, even if not
all old Pricers have been ported to the new framework yet.
Even if slightly outdated I suggest you read QuEP 5 "Using replaceable
pricing engines in option implementations"
(
http://quantlib.org/quep/quep005.html), then take a look at the code under
ql\PricingEngines.
Of course I might be just missing your point, in which case please forgive
me and try again: your contribution is appreciated.
ciao -- Nando