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

COS-method Heston engine based on efficient Fourier series expansions. More...

#include <coshestonengine.hpp>

+ Inheritance diagram for COSHestonEngine:
+ Collaboration diagram for COSHestonEngine:

Public Member Functions

 COSHestonEngine (const ext::shared_ptr< HestonModel > &model, Real L=16, Size N=200)
 
void update () override
 
void calculate () const override
 
std::complex< RealchF (Real u, Real t) const
 
Real c1 (Time t) const
 
Real c2 (Time t) const
 
Real c3 (Time t) const
 
Real c4 (Time t) const
 
Real mu (Time t) const
 
Real var (Time t) const
 
Real skew (Time t) const
 
Real kurtosis (Time t) const
 
- 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 Member Functions

Real muT (Time t) const
 

Private Attributes

const Real L_
 
const Size N_
 
Real kappa_
 
Real theta_
 
Real sigma_
 
Real rho_
 
Real v0_
 

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

COS-method Heston engine based on efficient Fourier series expansions.

References:

F. Fang, C.W. Oosterlee: A Novel Pricing Method for European Ooptions based on Fourier-Cosine Series Expansions, http://ta.twi.tudelft.nl/mf/users/oosterle/oosterlee/COS.pdf

Fabien Le Floc'h: Fourier Integration and Stochastic Volatility Calibration, https://papers.ssrn.com/sol3/papers2.cfm?abstract_id=2362968

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

Definition at line 53 of file coshestonengine.hpp.

Constructor & Destructor Documentation

◆ COSHestonEngine()

COSHestonEngine ( const ext::shared_ptr< HestonModel > &  model,
Real  L = 16,
Size  N = 200 
)
explicit

Definition at line 26 of file coshestonengine.cpp.

Member Function Documentation

◆ 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 39 of file coshestonengine.cpp.

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

◆ calculate()

void calculate ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 52 of file coshestonengine.cpp.

+ Here is the call graph for this function:

◆ chF()

std::complex< Real > chF ( Real  u,
Real  t 
) const

Definition at line 132 of file coshestonengine.cpp.

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

◆ c1()

Real c1 ( Time  t) const

Definition at line 177 of file coshestonengine.cpp.

+ Here is the caller graph for this function:

◆ c2()

Real c2 ( Time  t) const

Definition at line 183 of file coshestonengine.cpp.

+ Here is the caller graph for this function:

◆ c3()

Real c3 ( Time  t) const

Definition at line 199 of file coshestonengine.cpp.

+ Here is the caller graph for this function:

◆ c4()

Real c4 ( Time  t) const

Definition at line 228 of file coshestonengine.cpp.

+ Here is the caller graph for this function:

◆ mu()

Real mu ( Time  t) const

Definition at line 288 of file coshestonengine.cpp.

+ Here is the call graph for this function:

◆ var()

Real var ( Time  t) const

Definition at line 291 of file coshestonengine.cpp.

+ Here is the call graph for this function:

◆ skew()

Real skew ( Time  t) const

Definition at line 294 of file coshestonengine.cpp.

+ Here is the call graph for this function:

◆ kurtosis()

Real kurtosis ( Time  t) const

Definition at line 297 of file coshestonengine.cpp.

+ Here is the call graph for this function:

◆ muT()

Real muT ( Time  t) const
private

Definition at line 127 of file coshestonengine.cpp.

Member Data Documentation

◆ L_

const Real L_
private

Definition at line 80 of file coshestonengine.hpp.

◆ N_

const Size N_
private

Definition at line 81 of file coshestonengine.hpp.

◆ kappa_

Real kappa_
private

Definition at line 82 of file coshestonengine.hpp.

◆ theta_

Real theta_
private

Definition at line 82 of file coshestonengine.hpp.

◆ sigma_

Real sigma_
private

Definition at line 82 of file coshestonengine.hpp.

◆ rho_

Real rho_
private

Definition at line 82 of file coshestonengine.hpp.

◆ v0_

Real v0_
private

Definition at line 82 of file coshestonengine.hpp.