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

Finite-differences Heston Hull-White vanilla option engine. More...

#include <fdhestonhullwhitevanillaengine.hpp>

+ Inheritance diagram for FdHestonHullWhiteVanillaEngine:
+ Collaboration diagram for FdHestonHullWhiteVanillaEngine:

Public Member Functions

 FdHestonHullWhiteVanillaEngine (const ext::shared_ptr< HestonModel > &model, ext::shared_ptr< HullWhiteProcess > hwProcess, Real corrEquityShortRate, Size tGrid=50, Size xGrid=100, Size vGrid=40, Size rGrid=20, Size dampingSteps=0, bool controlVariate=true, const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Hundsdorfer())
 
 FdHestonHullWhiteVanillaEngine (const ext::shared_ptr< HestonModel > &model, ext::shared_ptr< HullWhiteProcess > hwProcess, DividendSchedule dividends, Real corrEquityShortRate, Size tGrid=50, Size xGrid=100, Size vGrid=40, Size rGrid=20, Size dampingSteps=0, bool controlVariate=true, const FdmSchemeDesc &schemeDesc=FdmSchemeDesc::Hundsdorfer())
 
void calculate () const override
 
void update () override
 
void enableMultipleStrikesCaching (const std::vector< Real > &strikes)
 
- Public Member Functions inherited from GenericModelEngine< HestonModel, VanillaOption::arguments, VanillaOption::results >
 GenericModelEngine (Handle< HestonModel > model=Handle< HestonModel >())
 
 GenericModelEngine (const ext::shared_ptr< HestonModel > &model)
 
- Public Member Functions inherited from GenericEngine< ArgumentsType, ResultsType >
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 ()
 
 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 ()
 

Private Attributes

const ext::shared_ptr< HullWhiteProcesshwProcess_
 
DividendSchedule dividends_
 
const Real corrEquityShortRate_
 
const Size tGrid_
 
const Size xGrid_
 
const Size vGrid_
 
const Size rGrid_
 
const Size dampingSteps_
 
const FdmSchemeDesc schemeDesc_
 
const bool controlVariate_
 
std::vector< Realstrikes_
 
std::vector< std::pair< VanillaOption::arguments, VanillaOption::results > > cachedArgs2results_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Attributes inherited from GenericModelEngine< HestonModel, VanillaOption::arguments, VanillaOption::results >
Handle< HestonModelmodel_
 
- Protected Attributes inherited from GenericEngine< ArgumentsType, ResultsType >
ArgumentsType arguments_
 
ResultsType results_
 

Detailed Description

Finite-differences Heston Hull-White vanilla option engine.

Tests:
the correctness of the returned value is tested by reproducing results available in web/literature and comparison with Black/Heston pricing.

Definition at line 43 of file fdhestonhullwhitevanillaengine.hpp.

Constructor & Destructor Documentation

◆ FdHestonHullWhiteVanillaEngine() [1/2]

FdHestonHullWhiteVanillaEngine ( const ext::shared_ptr< HestonModel > &  model,
ext::shared_ptr< HullWhiteProcess hwProcess,
Real  corrEquityShortRate,
Size  tGrid = 50,
Size  xGrid = 100,
Size  vGrid = 40,
Size  rGrid = 20,
Size  dampingSteps = 0,
bool  controlVariate = true,
const FdmSchemeDesc schemeDesc = FdmSchemeDesc::Hundsdorfer() 
)

Definition at line 36 of file fdhestonhullwhitevanillaengine.cpp.

◆ FdHestonHullWhiteVanillaEngine() [2/2]

FdHestonHullWhiteVanillaEngine ( const ext::shared_ptr< HestonModel > &  model,
ext::shared_ptr< HullWhiteProcess hwProcess,
DividendSchedule  dividends,
Real  corrEquityShortRate,
Size  tGrid = 50,
Size  xGrid = 100,
Size  vGrid = 40,
Size  rGrid = 20,
Size  dampingSteps = 0,
bool  controlVariate = true,
const FdmSchemeDesc schemeDesc = FdmSchemeDesc::Hundsdorfer() 
)

Definition at line 55 of file fdhestonhullwhitevanillaengine.cpp.

Member Function Documentation

◆ calculate()

void calculate ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 75 of file fdhestonhullwhitevanillaengine.cpp.

+ Here is the call graph for this function:

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Reimplemented from GenericEngine< ArgumentsType, ResultsType >.

Definition at line 232 of file fdhestonhullwhitevanillaengine.cpp.

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

◆ enableMultipleStrikesCaching()

void enableMultipleStrikesCaching ( const std::vector< Real > &  strikes)

Definition at line 239 of file fdhestonhullwhitevanillaengine.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ hwProcess_

const ext::shared_ptr<HullWhiteProcess> hwProcess_
private

Definition at line 80 of file fdhestonhullwhitevanillaengine.hpp.

◆ dividends_

DividendSchedule dividends_
private

Definition at line 81 of file fdhestonhullwhitevanillaengine.hpp.

◆ corrEquityShortRate_

const Real corrEquityShortRate_
private

Definition at line 82 of file fdhestonhullwhitevanillaengine.hpp.

◆ tGrid_

const Size tGrid_
private

Definition at line 83 of file fdhestonhullwhitevanillaengine.hpp.

◆ xGrid_

const Size xGrid_
private

Definition at line 83 of file fdhestonhullwhitevanillaengine.hpp.

◆ vGrid_

const Size vGrid_
private

Definition at line 83 of file fdhestonhullwhitevanillaengine.hpp.

◆ rGrid_

const Size rGrid_
private

Definition at line 83 of file fdhestonhullwhitevanillaengine.hpp.

◆ dampingSteps_

const Size dampingSteps_
private

Definition at line 84 of file fdhestonhullwhitevanillaengine.hpp.

◆ schemeDesc_

const FdmSchemeDesc schemeDesc_
private

Definition at line 85 of file fdhestonhullwhitevanillaengine.hpp.

◆ controlVariate_

const bool controlVariate_
private

Definition at line 86 of file fdhestonhullwhitevanillaengine.hpp.

◆ strikes_

std::vector<Real> strikes_
private

Definition at line 88 of file fdhestonhullwhitevanillaengine.hpp.

◆ cachedArgs2results_

std::vector<std::pair<VanillaOption::arguments, VanillaOption::results> > cachedArgs2results_
mutableprivate

Definition at line 91 of file fdhestonhullwhitevanillaengine.hpp.