QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
DengLiZhouBasketEngine Class Reference

Pricing engine for basket option on multiple underlyings. More...

#include <denglizhoubasketengine.hpp>

+ Inheritance diagram for DengLiZhouBasketEngine:
+ Collaboration diagram for DengLiZhouBasketEngine:

Public Member Functions

 DengLiZhouBasketEngine (std::vector< ext::shared_ptr< GeneralizedBlackScholesProcess > > processes, Matrix rho)
 
void calculate () const override
 
- Public Member Functions inherited from GenericEngine< BasketOption::arguments, BasketOption::results >
PricingEngine::argumentsgetArguments () const override
 
const PricingEngine::resultsgetResults () const override
 
void reset () override
 
void update () override
 
- Public Member Functions inherited from PricingEngine
 ~PricingEngine () override=default
 
virtual argumentsgetArguments () const =0
 
virtual const resultsgetResults () const =0
 
virtual void reset ()=0
 
virtual void calculate () const =0
 
- Public Member Functions inherited from Observable
 Observable ()=default
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 

Static Private Member Functions

static Real calculate_vanilla_call (const Array &s, DiscountFactor dr, const Array &dq, const Array &v, const Matrix &rho, Time T)
 
static Real I (Real u, Real tF2, const Matrix &D, const Matrix &DF, Size i)
 

Private Attributes

const Size n_
 
const std::vector< ext::shared_ptr< GeneralizedBlackScholesProcess > > processes_
 
const Matrix rho_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Attributes inherited from GenericEngine< BasketOption::arguments, BasketOption::results >
BasketOption::arguments arguments_
 
BasketOption::results results_
 

Detailed Description

Pricing engine for basket option on multiple underlyings.

This class implements the pricing formula from "Multi-asset Spread Option Pricing and Hedging", S. Deng, M. Li, J.Zhou, 2008 https://mpra.ub.uni-muenchen.de/8259/1/MPRA_paper_8259.pdf

The typo in formula (37) for J^2 is corrected

This pricing formula only works if exactly one asset weight is positive. If more than one weight is positive then a mapping of the sum of correlated log-normal processes onto one log-normal process has to be carried out. This implementation is using: "WKB Approximation for the Sum of Two Correlated Lognormal Random Variables", C.F. Lo 2013 https://www.m-hikari.com/ams/ams-2013/ams-125-128-2013/loAMS125-128-2013.pdf for this task.

Tests:
the correctness of the returned value is tested by reproducing results available in literature.

Definition at line 54 of file denglizhoubasketengine.hpp.

Constructor & Destructor Documentation

◆ DengLiZhouBasketEngine()

DengLiZhouBasketEngine ( std::vector< ext::shared_ptr< GeneralizedBlackScholesProcess > >  processes,
Matrix  rho 
)

Definition at line 31 of file denglizhoubasketengine.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ calculate()

void calculate ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 46 of file denglizhoubasketengine.cpp.

+ Here is the call graph for this function:

◆ calculate_vanilla_call()

Real calculate_vanilla_call ( const Array s,
DiscountFactor  dr,
const Array dq,
const Array v,
const Matrix rho,
Time  T 
)
staticprivate

Definition at line 207 of file denglizhoubasketengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ I()

Real I ( Real  u,
Real  tF2,
const Matrix D,
const Matrix DF,
Size  i 
)
staticprivate

Definition at line 182 of file denglizhoubasketengine.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ n_

const Size n_
private

Definition at line 69 of file denglizhoubasketengine.hpp.

◆ processes_

const std::vector<ext::shared_ptr<GeneralizedBlackScholesProcess> > processes_
private

Definition at line 70 of file denglizhoubasketengine.hpp.

◆ rho_

const Matrix rho_
private

Definition at line 71 of file denglizhoubasketengine.hpp.