QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Base class for FFT pricing engines for European vanilla options. More...
#include <fftengine.hpp>
Public Member Functions | |
FFTEngine (ext::shared_ptr< StochasticProcess1D > process, Real logStrikeSpacing) | |
void | calculate () const override |
void | update () override |
void | precalculate (const std::vector< ext::shared_ptr< Instrument > > &optionList) |
virtual std::unique_ptr< FFTEngine > | clone () const =0 |
Protected Member Functions | |
virtual void | precalculateExpiry (Date d)=0 |
virtual std::complex< Real > | complexFourierTransform (std::complex< Real > u) const =0 |
virtual Real | discountFactor (Date d) const =0 |
virtual Real | dividendYield (Date d) const =0 |
void | calculateUncached (const ext::shared_ptr< StrikedTypePayoff > &payoff, const ext::shared_ptr< Exercise > &exercise) const |
Protected Attributes | |
ext::shared_ptr< StochasticProcess1D > | process_ |
Real | lambda_ |
Private Types | |
typedef std::map< ext::shared_ptr< StrikedTypePayoff >, Real > | PayoffResultMap |
typedef std::map< Date, PayoffResultMap > | ResultMap |
Private Attributes | |
ResultMap | resultMap_ |
Base class for FFT pricing engines for European vanilla options.
The FFT engine calculates the values of all options with the same expiry at the same time. For that reason it is very inefficient to price options individually. When using this engine you should collect all the options you wish to price in a list and call the engine's precalculate method before calling the NPV method of the option.
References: Carr, P. and D. B. Madan (1998), "Option Valuation using the fast Fourier transform," Journal of Computational Finance, 2, 61-73.
Definition at line 47 of file fftengine.hpp.
|
private |
Definition at line 68 of file fftengine.hpp.
|
private |
Definition at line 69 of file fftengine.hpp.
FFTEngine | ( | ext::shared_ptr< StochasticProcess1D > | process, |
Real | logStrikeSpacing | ||
) |
Definition at line 29 of file fftengine.cpp.
|
override |
|
override |
Definition at line 58 of file fftengine.cpp.
void precalculate | ( | const std::vector< ext::shared_ptr< Instrument > > & | optionList | ) |
|
pure virtual |
Implemented in FFTVanillaEngine, and FFTVarianceGammaEngine.
|
protectedpure virtual |
Implemented in FFTVanillaEngine, and FFTVarianceGammaEngine.
|
protectedpure virtual |
Implemented in FFTVanillaEngine, and FFTVarianceGammaEngine.
Implemented in FFTVanillaEngine, and FFTVarianceGammaEngine.
Implemented in FFTVanillaEngine, and FFTVarianceGammaEngine.
|
protected |
Definition at line 67 of file fftengine.cpp.
|
protected |
Definition at line 64 of file fftengine.hpp.
|
protected |
Definition at line 65 of file fftengine.hpp.
|
private |
Definition at line 70 of file fftengine.hpp.