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
AnalyticHestonForwardEuropeanEngine Class Reference

Analytic Heston engine incl. stochastic interest rates. More...

#include <analytichestonforwardeuropeanengine.hpp>

+ Inheritance diagram for AnalyticHestonForwardEuropeanEngine:
+ Collaboration diagram for AnalyticHestonForwardEuropeanEngine:

Public Member Functions

 AnalyticHestonForwardEuropeanEngine (ext::shared_ptr< HestonProcess > process, Size integrationOrder=144)
 
void calculate () const override
 
Real propagator (Time resetTime, Real varReset) const
 
ext::shared_ptr< AnalyticHestonEngineforwardChF (Handle< Quote > &spotReset, Real varReset) const
 
- Public Member Functions inherited from GenericEngine< ForwardOptionArguments< VanillaOption::arguments >, VanillaOption::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 ()
 
 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

std::pair< Real, RealcalculateP1P2 (Time t, Handle< Quote > &St, Real K, Real ratio, Real phiRightLimit=100) const
 
std::pair< Real, RealcalculateP1P2Hat (Time tenor, Time resetTime, Real K, Real ratio, Real phiRightLimit=100, Real nuRightLimit=2.0) const
 

Private Attributes

ext::shared_ptr< HestonProcessprocess_
 
Size integrationOrder_
 
Real v0_
 
Real rho_
 
Real kappa_
 
Real theta_
 
Real sigma_
 
Handle< YieldTermStructuredividendYield_
 
Handle< YieldTermStructureriskFreeRate_
 
Handle< Quotes0_
 
Real kappaHat_
 
Real thetaHat_
 
Real R_
 
GaussLegendreIntegration outerIntegrator_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 
- Protected Attributes inherited from GenericEngine< ForwardOptionArguments< VanillaOption::arguments >, VanillaOption::results >
ForwardOptionArguments< VanillaOption::argumentsarguments_
 
VanillaOption::results results_
 

Detailed Description

Analytic Heston engine incl. stochastic interest rates.

This class is pricing a european option under the following process

\[ \begin{array}{rcl} dS(t, S) &=& (r-d) S dt +\sqrt{v} S dW_1 \\ dv(t, S) &=& \kappa (\theta - v) dt + \sigma \sqrt{v} dW_2 \\ dW_1 dW_2 &=& \rho dt \\ \end{array} \]

References:

Implements the analytical solution for forward-starting strike-reset options descriped in "On the Pricing of Forward Starting Options under Stochastic Volatility", S. Kruse (2003)

Tests:
  • For tReset > 0, price from the analytic pricer is compared to the MC priver for calls/puts at various moneynesses
  • For tReset ~ 0, price from the analytic pricer is compared to the Heston analytic vanilla pricer for various options

Definition at line 64 of file analytichestonforwardeuropeanengine.hpp.

Constructor & Destructor Documentation

◆ AnalyticHestonForwardEuropeanEngine()

AnalyticHestonForwardEuropeanEngine ( ext::shared_ptr< HestonProcess process,
Size  integrationOrder = 144 
)
explicit

Definition at line 95 of file analytichestonforwardeuropeanengine.cpp.

Member Function Documentation

◆ calculate()

void calculate ( ) const
overridevirtual

Implements PricingEngine.

Definition at line 121 of file analytichestonforwardeuropeanengine.cpp.

+ Here is the call graph for this function:

◆ propagator()

Real propagator ( Time  resetTime,
Real  varReset 
) const

Definition at line 218 of file analytichestonforwardeuropeanengine.cpp.

+ Here is the call graph for this function:

◆ forwardChF()

ext::shared_ptr< AnalyticHestonEngine > forwardChF ( Handle< Quote > &  spotReset,
Real  varReset 
) const

Definition at line 233 of file analytichestonforwardeuropeanengine.cpp.

+ Here is the caller graph for this function:

◆ calculateP1P2()

std::pair< Real, Real > calculateP1P2 ( Time  t,
Handle< Quote > &  St,
Real  K,
Real  ratio,
Real  phiRightLimit = 100 
) const
private

Definition at line 253 of file analytichestonforwardeuropeanengine.cpp.

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

◆ calculateP1P2Hat()

std::pair< Real, Real > calculateP1P2Hat ( Time  tenor,
Time  resetTime,
Real  K,
Real  ratio,
Real  phiRightLimit = 100,
Real  nuRightLimit = 2.0 
) const
private

Definition at line 193 of file analytichestonforwardeuropeanengine.cpp.

+ Here is the caller graph for this function:

Member Data Documentation

◆ process_

ext::shared_ptr<HestonProcess> process_
private

Definition at line 83 of file analytichestonforwardeuropeanengine.hpp.

◆ integrationOrder_

Size integrationOrder_
private

Definition at line 84 of file analytichestonforwardeuropeanengine.hpp.

◆ v0_

Real v0_
private

Definition at line 87 of file analytichestonforwardeuropeanengine.hpp.

◆ rho_

Real rho_
private

Definition at line 87 of file analytichestonforwardeuropeanengine.hpp.

◆ kappa_

Real kappa_
private

Definition at line 87 of file analytichestonforwardeuropeanengine.hpp.

◆ theta_

Real theta_
private

Definition at line 87 of file analytichestonforwardeuropeanengine.hpp.

◆ sigma_

Real sigma_
private

Definition at line 87 of file analytichestonforwardeuropeanengine.hpp.

◆ dividendYield_

Handle<YieldTermStructure> dividendYield_
private

Definition at line 88 of file analytichestonforwardeuropeanengine.hpp.

◆ riskFreeRate_

Handle<YieldTermStructure> riskFreeRate_
private

Definition at line 89 of file analytichestonforwardeuropeanengine.hpp.

◆ s0_

Handle<Quote> s0_
private

Definition at line 90 of file analytichestonforwardeuropeanengine.hpp.

◆ kappaHat_

Real kappaHat_
private

Definition at line 93 of file analytichestonforwardeuropeanengine.hpp.

◆ thetaHat_

Real thetaHat_
private

Definition at line 93 of file analytichestonforwardeuropeanengine.hpp.

◆ R_

Real R_
private

Definition at line 93 of file analytichestonforwardeuropeanengine.hpp.

◆ outerIntegrator_

GaussLegendreIntegration outerIntegrator_
private

Definition at line 98 of file analytichestonforwardeuropeanengine.hpp.