# QuantLib_AnalyticHestonEngine man page

AnalyticHestonEngine — analytic Heston-model engine based on Fourier transform

## Synopsis

`#include <ql/pricingengines/vanilla/analytichestonengine.hpp>`

Inherits **GenericModelEngine< HestonModel, VanillaOption::arguments, VanillaOption::results >**.

Inherited by **AnalyticHestonHullWhiteEngine**, BatesDoubleExpEngine, and **BatesEngine**.

### Public Types

enumComplexLogFormula{Gatheral,BranchCorrection}

### Public Member Functions

AnalyticHestonEngine(const boost::shared_ptr<HestonModel> &model,RealrelTolerance,SizemaxEvaluations)AnalyticHestonEngine(const boost::shared_ptr<HestonModel> &model,SizeintegrationOrder=144)AnalyticHestonEngine(const boost::shared_ptr<HestonModel> &model, ComplexLogFormula cpxLog, const Integration &itg)

voidcalculate() constSize numberOfEvaluations() const

### Static Public Member Functions

static voiddoCalculation(RealriskFreeDiscount,RealdividendDiscount,RealspotPrice,RealstrikePrice,Realterm,Realkappa,Realtheta,Realsigma,Realv0,Realrho, constTypePayoff&type, const Integration &integration, const ComplexLogFormula cpxLog, constAnalyticHestonEngine*const enginePtr,Real&value,Size&evaluations)

### Protected Member Functions

virtual std::complex<Real>addOnTerm(Realphi,Timet,Sizej) const

### Additional Inherited Members

## Detailed Description

analytic Heston-model engine based on Fourier transform

Integration detail: Two algebraically equivalent formulations of the complex logarithm of the Heston model exist. Gatherals [2005] (also Duffie, Pan and **Singleton** [2000], and Schoutens, Simons and Tistaert[2004]) version does not cause discoutinuities whereas the original version (e.g. Heston [1993]) needs some sort of 'branch correction' to work properly. Gatheral's version does also work with adaptive integration routines and should be preferred over the original Heston version.

References:

Heston, Steven L., 1993. A Closed-Form Solution for Options with Stochastic Volatility with Applications to **Bond** and **Currency** Options. The review of Financial Studies, Volume 6, Issue 2, 327-343.

A. Sepp, Pricing European-Style Options under Jump Diffusion Processes with Stochastic Volatility: Applications of Fourier Transform (http://math.ut.ee/~spartak/papers/stoch…)

R. Lord and C. Kahl, Why the rotation count algorithm works, http://papers.ssrn.com/sol3/papers.cfm?…

H. Albrecher, P. Mayer, W.Schoutens and J. Tistaert, The Little Heston Trap, http://www.schoutens.be/HestonTrap.pdf

J. Gatheral, The Volatility Surface: A Practitioner's Guide, Wiley Finance

**Tests**

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

**Examples:** **EquityOption.cpp**.

## Author

Generated automatically by Doxygen for QuantLib from the source code.

## Referenced By

AnalyticHestonEngine(3), doCalculation(3) and numberOfEvaluations(3) are aliases of QuantLib_AnalyticHestonEngine(3).