1. Pricing of Exotics under Stochastic
Volatility
Heston Model
Michael Mark
Department of Mathematics
University of Leicester
This dissertation is submitted for the degree of
Master of Science
Newton’s College September 2016
2. Declaration
All sentences or passages quoted in this project dissertation from other people’s work have
been specifically acknowledged by clear cross referencing to author, work and page(s). I
understand that failure to do this amounts to plagiarism and will be considered grounds for
failure in this module and the degree examination as a whole.
Michael Mark
September 2016
3. Acknowledgements
This empirical research was supervised by Dr. Bogdan Grechuk and Prof. Jeremy Levesley.
Special thanks belongs to Marco de Innocentis for providing his expertise and guidance.
Lastly I would like to thank to a fellow student Jan Sila for valuable comments and construc-
tive critique.
4. Abstract
The aim of this dissertation is to develop path generating engine for pricing path dependend
options under Heston stochastic volatility model and then utilize it to price Asian options
for S&P 500 index. Exotic option prices are relevant for practitioners and academics as
sources for reference prices are scarce. Secondly this piece of work could serve as a decent
sum up of mathematical and computational concepts underlying Heston model as well as
some of its extensions. During the research problems with Heston characteristic function
were acknowledged as it was unable to produce accurate prices for short maturities and
superiority of Lewis-Lipton formulation was empirically confirmed. The output are matlab
codes allowing for easy replication of this work and two .xlsx files containing Asian option
prices calibrated to S&P 500 volatility surface.
9. Chapter 1
Introduction
1.1 Why stochastic volatility?
The Black-Scholes formula is considered a kick starter of the field of quantitative finance.
After its launch, the transition from cursing alpha-male traders to nerds with their formulas
completely changed the industry. It was been a first "successful" attempt of describing
derivative valuation problem in pure mathematics. The formula led to a boom in options
trading and legitimised scientifically the activities of the Chicago Board Options Exchange
and other options markets around the world.[12].
The original model came with numerous quite restraining assumptions (e.g. frictionless
market, normally distributed returns of underlying, no dividend yield, constant volatility and
risk free rate etc.), from which some of them were later successfully dropped. The most
dubious of these is that continuously compounded stock returns are normally distributed
with constant volatility. This hypothesis is in a direct contradiction with numerous empirical
studies. It is a well recognised fact, that returns exhibit excess of skewness and curtosis not
present in normal distribution, often described as ’fat tails’.
Volatility is not in real world constant either, rather it is inversely related to stock price.
The presence of so called smiles and skews was brought to attention of academia and
practitioners soon after Black-Scholes formula was massively used in derivative trading
departments, challenging credibility of the whole model.
Even though some of the Black-Scholes shortcomings can be partly avoided by its
extensions, there was an imminent need for a new model which would mimic the market
movements more realistically. There are two main approaches for allowing time varying-
volatility.
Local volatility, where volatility is a deterministic function of time and the underlying’s
price, first proposed by Dupire [6] and stochastic volatility, which specifies volatility as
10. 1.2 Dissertation structure 2
(a) Effect of parameters on Skewness (b) Effect of parameters on Curtosis
Fig. 1.1 Terminal log-stock price density
driven by its own stochastic process. The latter forms so called Stochastic Volatility models
family represented by Hull and White [10], Scott, SABR or our objects of interest, the Heston
[9] model.
The Heston model is probably the most popular SV model though it wasn’t the first
one. It often serves as a benchmark for other SV models as it allows for semi-closed form
solution. The parameters of Heston are able to to introduce skewness and curtosis 1.1b 1.1a,
and produce smiles or skews in implied volatilities extracted from option prices generated
by the model. It also allows for inverse relationship between stock price and volatility in a
parsimonious way. Moreover, it was Heston who exploited characteristic function in option
pricing for the first time and thus brought Fourier transforms theory into option pricing.
1.2 Dissertation structure
Theory presented in this text tries to pick, consolidate and enrich by my own notes the best
parts from well-regarded textbooks [7] and [13]. The intention is to create a guide which is
easy to follow and replicate.
1.2.1 Reference Pricer
This dissertation consists of 5 chapters. Every chapter tries to cover and develop needed
amount of knowledge in a rigorous manner and subsequently present particular results. Even
though the principal focus of this dissertation is on path dependent options, we start by a
11. 1.2 Dissertation structure 3
general setup for pricing of vanilla options. In subsequent sections we develop a methodology
for calibrating Heston model to market data and for such application a need of a fast, reliable
pricing of market available data (vanillas) arises. (Exotics aren’t commonly traded on
exchanges and thus their data are not easily accessible). For this purpose we formulate a
solution based on Fourier transform of a characteristic function. The solution is semi-closed
form i.e. closed-form up to an integral that must be evaluated numerically. In chapter four
we present path generating engine and last chapter summarises the results.
12. Chapter 2
Benchmark
2.1 Model Dynamics
Heston model can be represented by a bivariate system of stochastic differential equations
dSt = µStdt +
√
vtStdW1
t
dvt = κ(θ −vt)+σ0
√
vtdW2
t
(2.1)
Where wiener processes are correlated in a way that E[dW1
t dW2
t ] = ρdt. We immediately
see that the stock price process is similar to the Black-Scholes one and that the variance
is modelled as CIR process [5]. We should note that the second equation of the bivariate
process models variance vt and not the volatility
√
vt . Parameters of the model are:
• µ drift of the stock price process
• κ > 0 mean reversion speed of the variance process
• θ > 0 mean reversion level of the variance process
• σ0 > 0 volatility of the variance
• ρ ∈ [−1,1]the correlation between the two Weiner processes
Equation 2.1 is often expressed in terms of log returns and volatility rather than stock price
and volatility.
13. 2.2 European Call 5
2.2 European Call
From arbitrage pricing theory we know, that the price of a European call option can be
expressed as a discounted expected payoff under the neutral Q measure.
C(St,vt,K,τ) = e−rτ
E[(ST −K)+
|St,vt]
= e−rτ
E[(ST −K)1ST >K|St,vt]
= e−rτ
E[(ST 1ST >K)|St,vt]
P1
−e−rτ
K E[1ST >K|St,vt]
P2
(2.2)
What we get is a formula very similar to the Black-Scholes one sometimes referred as à la
Black-Scholes. Indeed in Black-Scholes probabilities P1 and P2 are replaced with Φ(d1) and
Φ(d2) respectively. The quantities P1 and P2 represent probabilities that the option expires in
the money conditional on the value St = eXt and vt. However these probabilities are obtained
under different measures. For P2
P2 = EQ
[1ST >K|St,vt] = Q(ST > K) = Q(ln(ST ) > ln(K))
whereas for P1 we have to consider an appropriate change of measure. Define following
Radon-Nikodym derivative
dQ
dQS
=
BT /Bt
ST /St
=
EQ[eXT ]
eXt
(2.3)
where the dynamics of the bond follow
Bt = exp(
t
0
rdu) = ert
The last equality in 2.3 stems from the fact that under Q all assets grow at the risk free
rate i.e.
BT /Bt
ST /St
=
er(T−t)St
ST
=
EQ[ST ]
ST
(2.4)
And thus the first expectation on the thrid line of 2.2 is equal to
e−r(T−t)
EQ
[(ST −K)1ST >K] = StEQ ST /St
BT /Bt
1ST >K = StEQS ST /St
BT /Bt
1ST >K
dQ
dQS
=
= StEQS
[1ST >K] = StQS
(ST > K) = StP1
(2.5)
14. 2.3 Probabilites Recovery 6
And now combining both previous results we obtain
C(St,vt,K,τ) = St QS
(ST > K)
P1
−Kerτ
Q(ST > K)
P2
(2.6)
It is worth pointing out that measure Q uses bond Bt as numeraire whereas QS uses stock
price St. This derivation follows to certain extent the approach of Bakshi and Madan [2]
from 2000. In their paper they go even further proving 2.6 but under a general setup. From
their work it is easy to see that when St follows a log-normal distribution 2.6 becomes the
famous Black-Scholes formula.
2.3 Probabilites Recovery
First we need to refresh what a continuous Fourier transform is.
f(x) = F−1
[F(k)](x) =
+∞
−∞
F(k)e2πikx
dk
F(k) = F[f(x)](k) =
+∞
−∞
f(x)e−2πikx
(2.7)
Pair 2.7 of integral transformations represents a so called inverse and forward transform.
In physics and often in quantitative finance authors use following notation ω = 2πv. This
is a simple linear transformation which uses angular frequency ω rather than oscillation
frequency v. Result of this transformation is a non-symmetric pair
f(x) = F−1
[F(k)](x) =
1
2π
+∞
−∞
F(ω)eiωx
dω
F(k) = F[f(x)](k) =
+∞
−∞
f(x)e−iωx
(2.8)
It is important to note that the inverse Fourier transform of a probability density function is
its characteristic function. Indeed
ϕX(t) = E[eitX
] =
+∞
−∞
eitx
dFX(x) =
+∞
−∞
fX(x)eitx
dx (2.9)
From previous section we know that P1 and P2 represent the probabilities of call expiring
in the money. These probabilities can be relatively easily recovered using the Gill-Palaez
version of the inversion theorem. First we need to introduce an integral representation of the
15. 2.3 Probabilites Recovery 7
sgn function derived in [4].
sgnα =
1
π
+∞
−∞
sinαx
x
dx (2.10)
Now let f(x) be a density of lnSt and F(x) its distribution function.
+∞
−∞
sgn(x−y)f(x)dx =
+∞
y
sgn(x−y)f(x)dx−
y
−∞
sgn(y−x)f(x)dx = [1−F(y)]−F(y) = 1−2F(y)
(2.11)
This identity will play a key role in the derivation of Pi.
P(lnST > lnK) =
∞
lnK
f(x)dx =
1
2π
∞
nK
+∞
−∞
e−iux
ϕ(u)u dx
=
1
2π
+∞
−∞
ϕ(u)
∞
lnK
e−iux
dx du
(2.12)
Evaluating the inner integral we get
P(lnST > K) =
1
2π
+∞
−∞
ϕ(u)
e−iuK
iu
du−
1
2π
lim
R→∞
∞
−∞
ϕ(u)
e−iuR
iu
du (2.13)
In the second integrand of 2.13, we express ϕ(u) as a Fourier transform yielding
1
2π
lim
R→∞
+∞
−∞
+∞
−∞
eiux
f(x)dx
e−iuR
iu
du (2.14)
=
1
2π
lim
R→∞
+∞
−∞
f(x)
+∞
−∞
eiu(x−R)
iu
du dx (2.15)
=
1
2π
lim
R→∞
+∞
−∞
f(x)
+∞
−∞
1
i
cos(u(x−R))
u
+
sin(u(x−R))
u
du dx (2.16)
=
1
2π
+∞
−∞
πsgn(x−R)f(x)dx (2.17)
=
1
2
lim
R→∞
(1−2F(R)) = −
1
2
(2.18)
In 2.16 we used Euler identity. The first term with cosinus is clearly an odd function and
thus its integral disappears when integrated over (−∞,∞), while the second term is replaced
by 2.10. The 2.18 was obtained using derivation 2.11. Hence the result
Pr(lnST > K) =
1
2
+
1
2π
+∞
−∞
ϕ(u)
e−iulnK
iu
du (2.19)
16. 2.4 Characteristic function recovery 8
Lastly, applying Euler identity once again to the integrand of 2.19, we see that the integrand
is odd in its imaginary part and even in its real part. Hence we can write
Pi = P(lnSt > lnK) =
1
2
+
1
π
+∞
0
ℜ ϕ(u)
e−iulnK
iu
du (2.20)
Now we see, that the problem of pricing European options breaks down into an evaluation
of a numerical integral, namely two integrals. However it is possible to consolidate these
integrals and thus save some computational power. In the following derivation we will also
include continuous dividend yield which is essential in any equity/forex pricing setup. This
formula bellow differs from the 2.2 only in including term e−rq in the P1 term as explained in
[15].
C(K) = Ste−rq
P1 −Kerτ
P2 =
1
2
Ste−rq
−
1
2
Kerτ
+
+
1
π
+∞
0
ℜ
e−iulnK
iu
(Ste−rq
f1(u,x,v)−Kerτ
f2(u,x,v)) du
(2.21)
2.4 Characteristic function recovery
Finally we are missing the very last part of our benchmark pricer and that is the characteristic
function itself. In order to evaluate obtain european call/put price, we need to numerically
evaluate 2.21 which include up to now not mentioned characteristic functions f1 and f2.Due
the fact that the derivation is rather mathematically involved, we will try to treat this section
in slightly more heuristic way though not skipping an essential steps in the derivation, very
similarly to [14]. For a full proof and rigorous treatment of the derivation, readers are referred
to the original Heston’s paper.
2.4.1 Heston PDE
The derivation of Heston PDE is using a very similar argument as Black-Scholes, hedging
portfolio. However in Heston there is an extra source of uncertainty which needs to be
hedged away, stochastic volatility. We start by setting a portfolio consisting of an option
V =V(S,v,t), δ units of underlying stock and ϕ units of another option to hedge the volatility.
The value of portfolio is
Π = V +∆S+ϕU
dΠ = dV +∆dS+ϕdU
(2.22)
17. 2.4 Characteristic function recovery 9
As in the Black-Scholes hedging portfolio we use Ito lemma, however in this case multivariate
Ito lemma. Hence dS2
t = vS2d(W1
t )2 = vS2dt, dv2
t = σ2vdt and dStdVt = σvSdW1
t dW2
t =
ρσvSdt
dV =
∂V
∂t
dt +
∂V
∂S
dS+
∂V
∂v
dv+
1
2
vS2 ∂2V
∂S2
dt +
1
2
vσ2 ∂2V
∂v2
dt +σvρS
∂2V
∂S∂v
dt (2.23)
dU =
∂U
∂t
dt +
∂U
∂S
dS+
∂U
∂v
dv+
1
2
vS2 ∂2U
∂S2
dt +
1
2
vσ2 ∂2U
∂v2
dt +σvρS
∂2U
∂S∂v
dt (2.24)
Plugging results for V and U in 2.22 we get
dΠ = dV +∆dS+ϕdU
=
∂V
∂t
+
1
2
vS2 ∂2V
∂S2
dt +
1
2
vσ2 ∂2V
∂v2
+vσρS
∂2V
∂S∂v
dt dt+
+ϕ
∂U
∂t
+
1
2
vS2 ∂2U
∂S2
+
1
2
vσ2 ∂2U
∂v2
dt +vσρS
∂2U
∂S∂v
dt+
+
∂V
∂S
+ϕ
∂U
∂S
+∆ dS+
∂V
∂v
+ϕ
∂U
∂v
dv
(2.25)
Following the same reasoning as in Black-Scholes, we know that in order to have risk
free portfolio, we need to get rid of uncertainty represented by dS and dv. Thus the only
admissible choice is
ϕ = −
∂V
v
∂U
v
∆ = −ϕ
∂U
∂S
−
∂V
∂S
(2.26)
And consolidation all results yields a locally riskless portfolio
dΠ =
∂V
∂t
+
1
2
vS2 ∂2V
∂S2
dt +
1
2
vσ2 ∂2V
∂v2
+vσρS
∂2V
∂S∂v
dt dt+
+ϕ
∂U
∂t
+
1
2
vS2 ∂2U
∂S2
+
1
2
vσ2 ∂2U
∂v2
dt +vσρS
∂2U
∂S∂v
dt
(2.27)
In a no arbitrage setting the price process of any self-financed portfolio grows at a risk free
rate r (explained e.g. in [3] proposition 7.6). And thus
dΠ = r(V +∆S+ϕU)dt (2.28)
18. 2.4 Characteristic function recovery 10
Now putting together 2.27 and 2.28, rearranging and substituting for ϕ, ∆
∂V
∂t + 1
2vS2 ∂2V
∂S2 dt + 1
2vσ2 ∂2V
∂v2 +vσρS ∂2V
∂S∂vdt −rV +rS∂V
∂S
∂V
∂v
=
∂U
∂t + 1
2vS2 ∂2U
∂S2 + 1
2vσ2 ∂2U
∂v2 dt +vσρS ∂2U
∂S∂v −rU +rS∂U
∂S
∂U
∂v
(2.29)
It is easy to see that the left hand side is a function of V only while the right hand side is a
function of U. This implies that both sides of 2.29 can be written in terms of function f(S,v,t).
Heston in [9] specifies this function as
f(S,v,t) = −κ(θ −v)+λ(S,v,t) (2.30)
where λ(S,v,t) is the price of volatility risk. Substituting the left-hand side of 2.29 with
f(S,v,t) and rearranging in order to express Heston PDE in terms of price yields
−κ(θ −v)+λ(S,v,t) =
∂U
∂t + 1
2vS2 ∂2U
∂S2 + 1
2vσ2 ∂2U
∂v2 +vσρS ∂2U
∂S∂v −rU +rS∂U
∂S
∂U
∂v
(2.31)
∂U
∂t
+
1
2
vS2 ∂2U
∂S2
+
1
2
vσ2 ∂2U
∂v2
+vσρS
∂2U
∂S∂v
−rU +rS
∂U
∂S
+[κ(θ −v)+λ(S,v,t)]
∂U
∂v
= 0
(2.32)
This is the exact equation as in Heston’s original piece. The boundary for this PDE is given
by the european option payoff. At maturity the call is worth
U(S,v,T) = max(ST −K,0) (2.33)
Another set of conditions can be procured from the fact that a call on underlying with price 0
is worthless. Hence
U(0,v,t) = 0 (2.34)
As the stock price increases the delta of the option approaches 1.
lim
x→∞
∂U
∂S
(x,v,t) = 1 (2.35)
19. 2.4 Characteristic function recovery 11
and lastly as volatility increases the call option’s worth approaches the stock price.
lim
x→∞
∂U
∂S
(S,x,t) = S (2.36)
Heston PDE in terms of Log price
Expressing the Heston PDE 2.31 in Log price instead of price means substituting S, v and t
with x = lnS, v and t. The idea behind this change of variables is a simpler form of the PDE.
for change of variables we need derivatives
∂U
∂S
=
1
S
∂U
∂x
∂2U
∂S2
=
1
S2
∂2U
∂x2
∂2U
∂S∂v
=
1
S
∂U
∂x∂v
Plugging these derivatives into 2.31 gives us simplified form
∂U
∂t
+
1
2
v
∂2U
∂x2
+
1
2
vσ2 ∂2U
∂v2
+vσρ
∂2U
∂x∂v
−rU + r −
1
2
v
∂U
∂x
+[κ(θ −v)−λv]
∂U
∂v
= 0
(2.37)
notice that price of volatility risk λ(S,v,t) = vλ i.e. price of volatility risk is a linear function
of volatility as in Heston [9]. This comes from the Breeden’s consumption model.
2.4.2 PDE for P1 and P2
As derived in 2.6 european call price can be written
C(St,vt,L) = StP1 −e−rτ
KP2
where P1 and P2 are the probabilities of the option expiring in the money. Since the european
call satisfies the Heston PDE(therefore Heston log price PDE), we can take appropriate
derivatives with respect to time, volatility and stock price (log stock price) and substitute
them into the Heston PDE, thus obtaining Heston PDE in terms of P1 and P2. The needed
20. 2.4 Characteristic function recovery 12
derivatives are
∂C
∂t
= St
∂P1
∂t
−Ke−τr
rP2 +
∂P2
∂t
(2.38)
∂C
∂x
= St P1 +
∂P1
∂x
−Ke−τr ∂P2
∂x
(2.39)
∂2C
∂x2
= StP1 +2St
∂P1
∂x
+St
∂2P1
∂x2
−Ke−rτ ∂2P2
∂x2
= (2.40)
= St P1 +2
∂P1
∂x
+
∂2P1
∂x2
−Ke−rτ ∂2P2
∂x2
∂C
∂v
= St
∂P1
v
−Ke−rτ ∂P2
∂v
(2.41)
∂2C
∂v2
= St
∂2P1
∂v2
−Ke−rτ ∂2P2
∂v2
(2.42)
∂2C
∂v∂x
= St
∂P1
∂v
+
∂2P1
∂v∂x
−Ke−rτ ∂2P2
∂v∂x
(2.43)
Now substituting these into 2.44 yields
St
∂P1
∂t
−Ke−τr
rP2 +
∂P2
∂t
+
1
2
v St P1 +2
∂P1
∂x
+
∂2P1
∂x2
−Ke−rτ ∂2P2
∂x2
+
+
1
2
vσ2
St
∂2P1
∂v2
−Ke−rτ ∂2P2
∂v2
+vσρ St
∂P1
∂v
+
∂2P1
∂v∂x
−Ke−rτ ∂2P2
∂v∂x
−
−rU + r −
1
2
v St P1 +
∂P1
∂x
−Ke−τr ∂P2
∂x
+[κ(θ −v)−λv] St
∂P1
v
−Ke−rτ ∂P2
∂v
= 0
(2.44)
Which is a very tedious and absolutely not transparent expression. However as Heston
proposes the PDE 2.44 holds for any choice of parameters, particularly for any strike price
K ≥ 0, actual stock price St ≥ 0 and any risk free rate r ≥ 0. This is an important revelation
since if we chose parameters in a convenient manner we can obtain PDEs for P2 or P1 only.
Indeed setting K = 0 and St = 1 leaves us with a PDE for P1 while K = 1 and St = 0 with
PDE for P2. And thus PDEs for P1 is
∂P1
∂t
+ r+
1
2
v
∂P1
∂x
+
1
2
v
∂2P1
∂x2
+ρσv
∂2P1
∂v∂x
+[ρσv+κ(θ −v)−λv]
∂P1
∂v
+
1
2
σ2
v
∂2P1
∂v2
= 0
(2.45)
21. 2.4 Characteristic function recovery 13
and for P2
∂P2
∂t
+
1
2
v
∂2P2
∂x2
+(r −
1
2
v)
∂P2
∂x
+ρσv
∂2P2
∂x∂v
+
1
2
σ2
v
∂2P2
∂v2
+[ρσv+κ(θ −v)−λv]
∂P2
∂v
= 0
(2.46)
with an easily justified condition
Pi = 1ST >K ∀i = 1,2 (2.47)
This simply means that the probability of a call expiring in the money when ST > K is one as
expected.
2.4.3 The Heston Characteristic Function
Now to the final point of this section, the derivation itself. Heston assumes the characteristic
function for the x = lnST is of the form
fj(φ,x,v) = eCj(τ,φ)+Dj(τ,φ)v0+iφx
(2.48)
where Cj and Dj are coefficients yet to be determined and τ = T −t. PDEs can be written
and sometimes this form is preferred in terms of τ rather than t. This corresponds to a simple
linear transformations which only changes sign at the first term ∂Pi
∂t = −∂Pi
∂τ The characteristic
function has to satisfy PDEs for P1 and P2 as a consequence of Feynman-Kac theorem. From
Feynman-Kac we know that if a function f((lnSt,vt),t) of Heston bivariate SDE (lnSt,vt)
follows PDE ∂ f
∂t −r f +A f = 0 which is exactly of the same form as PDE for Pi. Outline of
the multivariate Feynmann-Kac theorem can be found in the appendix 1. Hence the solution
is given as a conditional expectation
f((lnSt,vt),t) = EQ
[f((lnST ,vT ),T)|Ft] (2.49)
using f((lnSt,vt),t) = exp(iφlnSt) yields
f((lnSt,vt),t) = EQ
[eiφlnSt
|xt,vt] (2.50)
which is the definition of the characteristic function for x = lnSt The PDE for the characteristic
function according to the reasoning above has to be of a form
−
∂ fj
∂τ
+ρvσ
∂2 fj
∂x∂v
+
1
2
v
∂2 fj
∂x2
+
1
2
vσ2 ∂2 fj
∂v2
+(r +ujv)
∂ fj
∂x
+(κθ −bjv)
∂ fj
∂v
= 0 (2.51)
22. 2.4 Characteristic function recovery 14
where uj adn bj are defined by u1 = 1
2, u2 = −1
2, b1 = κ +λ −ρσ, b2 = κ +λ. In order to
recover the characteristic function we need the following derivatives
∂ fj
∂τ
=
∂Cj
∂τ
+v
∂Dj
∂τ
fj
∂ fj
∂x
= iφ fj
∂ fj
∂v
= Dj fj
∂2 fj
∂x2
= −φ2
fj
∂2 fj
∂v2
= D2
j fj
∂2 fj
∂v∂x
= iφDj fj
Substituting these derivatives into 2.51 and dividing by fj gives us
−
∂Dj
∂τ
+v
∂Dj
∂τ
+ρvσiφDj −
1
2
vφ2
+
1
2
vσ2
D2
j +(r +ujv)iφ +(a−bjv)Dj = 0
Which can be rearranged to a more transparent expression
v −
∂Dj
∂τ
+ρσiφDj −
1
2
φ2
+
1
2
σ2
D2
j +ujiφ −bjDj −
∂Cj
∂τ
+riφ +aDj = 0 (2.52)
This is equivalent to two ODEs which has to be satisfied at the same time
∂Cj
∂τ
= riφ +aDj (2.53)
∂Dj
∂τ
= ρσiφDj −
1
2
φ2
+
1
2
σ2
D2
j +ujiφ −bjDj. (2.54)
The first equation 2.53 is straightforward to solve by integration with respect to τ when Dj
is known. The second equation 2.54 is a Riccati equation(i.e. quadratic in the unknown
function).
2.4.4 Solution to a general Riccati Equation
Complete solution to a general Riccati equation can be found in any textbook on differential
equations, hence we will not dive into details of its derivation and present only some results
of the theory and a sketch of the derivation. Heston Riccati equation is a differential equation
of a form
dy(t)
dt
= P(t)+Q(t)y(t)+R(t)y(t)2
(2.55)
23. 2.4 Characteristic function recovery 15
Non-linear differential equation 2.55 can be always transformed into 2nd order linear ODE.
If f is any solution of 2.55. Then then transformation
y = f +
1
v
(2.56)
reduces 2.55 to a linear equation in v. f is clearly a particular solution of 2.55 thus it has to
satisfy it. Also lets say that P,Q,R represent functions of t and thus carrying argument (t) is
henceforth unnecessary.
y′
= P+Qy+Ry2
(2.57)
if R is differentiable and non zero, v=yR satisfies a Riccati equation of a form
v′
= v2
+(Q+
R′
R
)v+RP (2.58)
because
v′
= (yR)′
= y′
R+yR′
= (P+Qy+Ry2
)R+v
R′
R
= PR+(Q+
R′
R
)v+v2
(2.59)
Substituting v = −u′
u gives us that u satisfies
u′′
−(Q+
R′
R
)+RP = 0 (2.60)
because
v′
= −
u′
u
′
= −
u′′
u
+
u′
u
2
= −
u′′
u
+v2
(2.61)
so that
u′′
u
= v2
−v′
= −PR− Q+
R′
R
v = −PR+ Q+
R′
R
u′
u
(2.62)
and thus
u′′
− Q+
R′
R
u′
+PRu = 0 (2.63)
The solution of this equation will lead to a solution of the original Riccati equation of a
form y = −u′
Ru . Differential equation 2.63 can be written as u′′ −au′ +cu = 0 with auxiliary
equation λ2 +bλ +c = 0 which has solution
λ+ =
−b+
√
b2 −4c
2
λ− =
−b−
√
b2 −4c
2
(2.64)
24. 2.4 Characteristic function recovery 16
and thus the solution of 2nd order ODE is given by a linear combination
u(t) = Meλ+t
+Neλ−t
where M and N are real constants. The solution to the Riccati equation 2.55 is therefore
y(t) =
Mλ
λ+t
e +Nλ
λ−t
e
R Meλ+t +Neλ−t
(2.65)
2.4.5 Riccati Equation for Heston
Applying the above derived theory to the Heston Riccati Equation and rewriting it to the
familiar form yields
∂Dj
∂τ
= Pj −QjDj +RD2
j (2.66)
with Pj = iujφ − 1
2φ2, Qj = bj −ρσiφ and R = 1
2σ2. From 2.65 we know the exact form
of the solution, which we will use in the numerical integration. Now we have developed
a framework for pricing european options as Heston in 1993. The pricer coded up in this
way is indeed a very simple one and in practice can be prone to errors. The issue lies in the
integrand 2.20
Re ϕ(u)
e−iulnK
iu
(2.67)
which can be very oscillatory especially at short maturities. Many remedies were proposed
to fix or belittle this problem such as integrand formulation named "Heston little trap" [8]
which derives the characteristic in such way that the integrand dampens quickly and don’t
oscillate that much. In my code I was forced to employ the Heston trap formulation as
the original Heston produced incorrect values for options with negligable intrinsic value.
Another and even more powerful enhancement of the benchmark model is to price vanillas
using Lewis-Lipton formula [11], which uses so called general Fourier transform. All three
approaches can be found in my matlab code.
25. Chapter 3
Model Calibration
The core of this project is to produce option prices for otherwise not publicly quoted/traded
exotic options. Clearly in order to price in accordance with the market, we need to calibrate
model parameters to the market. The idea is to chose parameters in such way that the model
prices are as close as possible to the market ones. However we want to price exotics and
option houses such as CBOE quote only european style options. This is where our benchmark
from previous section comes into play. First we fit our model so that it produces european
prices as close as possible to the market ones and then we use parameters obtained in this
procedure for pricing asian options. Optimizing to european options ensures that the drift of
the stock process is equivalent to the drift under martingale measure. This approach is called
calibration through loss function and it is an optimization task where we try to minimize
a loss function which represent the difference in prices (market vs model). Loss function
calibration is straightforward, easy to understand and thus very often advised. However loss
functions needs market option prices which may not be available for either illiquid or not
publicly traded underlying. In this is the case we opt for MLE [1] then however we need to
change the measure to riskless one because we optimized to the raw prices of the underlying.
3.1 Implied volatility
Options are often quoted in terms of implied volatilities rather than prices, thus a method
for transition between the two has to be established. Implied volatility is a value of the
volatility of the underlying instrument which when put into the Black-Scholes model returns
the market price of an option. One obvious advantage for quoting options in IV rather than
option price is that taking away all friction in the market and arbitrage opportunities, IVs for
puts and calls are equal.This can be easily seen from put-call parity where we substitute put
and call prices with appropriate Black-Scholes formula. Then it is evident that for the last
26. 3.2 Loss Function 18
equality to hold, volatilities of puts and calls have to be equal.
Call(t,K)−Put(t,K) = Spot −e−rτ
K
[φ(d1)Spot −φ(d2)K−rτ
]−[φ(−d2)Ke
−rτ −N(−d1)Spot] = Spot −e−rτ
K
Spot(φ(d1)+φ(−d1))−Ke−rτ
(φ(d2)+φ(−d2)) = Spot −e−rτ
K
(3.1)
There is a one to one relationship between option price an IV. Obtaining an appropriate
price given a certain level of IV is easy, simply insert IV into the appropriate Black-Scholes
formula.
C(S,t) = φ(d1)Spot −φ(d2)K−rτ
(3.2)
P(S,t) = φ(−d2)Ke
−rτ −N(−d1)Spot (3.3)
Recovering implied volatility from price is an inverse problem to pricing and is equivalent to
solving a nonlinear equation
C(S,t,σIV )−Cmarket = 0
P(S,t,σIV )−Pmarket = 0
where C/P means call/put Black-Scholes model price. For sake of the equation being non-
linear we need to employ a non-linear solver. I opted for the easiest but sufficient bisection
solver.
3.2 Loss Function
As we have explained above, we need to set up a loss function which we will try to minimize.
Each option is uniquely determined by a pair maturity and strike (τ,K). Now suppose that we
have a grid of option prices for strikes Kk where K ∈ [1,nk] and maturities τi where τ ∈ [1,nτ].
For each pair (τi,Kk) we have a market price C(τi,Kk) and Heston model price ˆC(τi,Kk).
There are multiple ways how to define a loss function but generally they fall into one of two
categories. Those which use volatilities and those which use prices.
27. 3.3 Implied Volatility Mean Square Error 19
3.2.1 Mean Square Error LF
MSE Loss function is defined as
1
N ∑
t,k
ωt,k Ct,k − ˆCt,k
2
(3.4)
where ω represent optional weights. One of main drawbacks of Mean square error loss
function is that options with negligible value i.e. deep OTM options of short maturities
contribute to 3.4 very little and thus the loss function tends to fit options with higher value at
the expense of those little valued. This translates into better fit for medium to long maturities
at the expense of short maturities. Basically we have two solutions to this issue. Either one
could fit to ITM options only or use a different formulation of a loss function. Fitting to
ITM can be problematic, because ITM options include the intristic price which is model
independent. However in practice and more particularly in my data, fitting to OTM or ITM
options didn’t make any significant difference. The other remedy is a different formulation
of the loss function.
3.2.2 Relative Mean Square Error LF
Defined as
1
N ∑
t,k
ωt,k
Ct,k − ˆCt,k
2
Ct,k
(3.5)
RMSE exhibits the opposite behaviour to the MSE formulation. Due to the presence of Ck,t
in the denominator of RMSE, RMSE tends to fit short maturities with very little market value
omitting long and medium maturities. The effect of options over or under contributing to
the sum of squares can be partially mitigated by assigning appropriate values of ωt,k, though
their choice is usually heuristic.
3.3 Implied Volatility Mean Square Error
Until now we have discussed only loss functions based on price. The second category of
loss functions are those based on implied volatility. They are defined in the same manner as
MSE using implied volatility instead of price. Even though the choice of IV instead of price
seems to be more than sensible since options are quoted in terms of volatility (or volatility
surface), for purposes of my dissertation they proved to be not useful as they are extremely
numerically demanding. Indeed fitting one option to IV means: calculate option price using
the benchmark, find its implied volatility, compare and repeat until convergence criterium is
28. 3.4 Data 20
met. Given that Heston model has no closed form solution for implied volatilities, they have
to be calculated using numerical solver and as a result fitting takes excessive amount of time.
3.4 Data
The data used for model calibration is a volatility surface of S&P 500 from 12th August
2016. It consists of 28 maturities ranging from 5 to 870 days over 9 strikes corresponding
to moneyness levels from 80% to 120%. Due to the size of the volatility surface, it is
not present here as a table but only as a surface plot. All data with descriptions can be
found in excel spreadsheet VolSurface.xls. First attempt to fit to OTM options using Gauss-
Fig. 3.1 Volatility Surface S&P 500
Laguere quadrature as a benchmark with MSE loss function formulation resulted in volatility
smile plot depicted on 3.2. Clearly fit is very crude for short and long maturities. When
IVmodel = −1, this means that the price is outside the no-arbitrage range and thus IVs cannot
be computed. The problem arises in numerical integration. Indeed when checking model
29. 3.4 Data 21
price we see that for very short maturities prices obtained are often negative which is in direct
contradiction with option theory. This is the result of Loss of Significance (subtracting two
quantities which are very close results in sizable numerical errors). Figure 3.3 represents
Fig. 3.2 Heston Gauss-Laguerre MSE Loss function
real part of the Heston integrand 2.67. We immediately see that there is a singularity in 0 and
for shorts maturities the integrand tends to be extremely oscilatory. These are the reasons
why Heston’s original formulation of the integrand may not be sufficient. For these reasons
I was forced to implement more advanced Lewis-Lipton formula which uses fundamental
Fourier transform [11]. Indeed using Lewis-Lipton improves the accuracy of the fit as can
be seen in 3.4. Again fit for short and long maturities is somewhat crude but for medium
maturities is almost perfect. Descriptive results of fits are present in table 3.1. We see that
best fit is produced using IVMSE, however the difference with respect to MSE isn’t very
significant given that the fit takes almost 14 times less time.
MSE RMSE IVMSE
time of fitting 38s 40s 514s
mean square error 1.68x10−3 5.63x10−2 9.63x10−4
Table 3.1 Fit Comparison using different Loss Functions
Produced smiles were obtained using matlab minimization procedure fmincon which is a
non-linear programming solver implemented by MathWorks. Bounds on parameter’s estimate
were set as in table 3.2 and chosen heuristically. Parameters obtained using this procedure
30. 3.4 Data 22
Fig. 3.3 Heston Integrand
Fig. 3.4 Volatility Smile using Lewis-Lipton
31. 3.4 Data 23
κ θ σ0 v0 ρ
lower bound 10−6 10−6 10−6 10−6 -0.999
upper bound 20 2 2 2 0.999
Table 3.2 Parameters’ bounds
κ θ σ0 v0 ρ
parameters 3.6858 0.0465 1.1664 0.0084 -0.7853
Table 3.3 Parameters’ estimate
are in 3.3 Matlab file HestonObjectiveFunction.m contains all introduced formulations
of the loss function. Recalibrating to any other volatility surface is easy as the function
paramestimation.m takes as input strikes, maturities and volatility surface.
32. Chapter 4
Path engine
Finally in order to price path dependent options, one must be able to simulate appropriate
paths. Arithmetic Asian option is similar to the european one in a way that we distinguish
between call and put options. However the payoff depends on the arithmetic average of
option prices rather than a terminal value. Hence the payoff for an asian call is
call = max(
1
T
T
0
S(t)dt −K,0) (4.1)
put = max(K −
1
T
T
0
S(t)dt,0) (4.2)
Such payoff is defined only on a continuous path thus we have to discretize the space first.
Recall that the Heston is driven by the 2-D process
dSt = µStdt +
√
vtStdW1
t
dvt = κ(θ −vt)+σ0
√
vtdW2
t
(4.3)
Both stock price and volatility can be written in an integral form
St+dt = St + µ
t+dt
t
Sudu+σ
t+dt
t
√
vuSudW1
u
dvt+dt = vt +κ
t+dt
t
(θ −vu)du+σ0
t+dt
t
√
vudW2
u
(4.4)
Discretization is creating a fine grid over continuous period [0,τ]
0 = t1 < t2 < ... < tN = τ (4.5)
and then calculating appropriate option prices in grid points.
33. 4.1 Euler Scheme 25
4.1 Euler Scheme
Euler discretization is equivalent to approximating integrals in the 4.1 as the left point integral
rule 4.2. Hence can be rewritten as 4.6, where the integral is approximated as a product of
Fig. 4.1 Left Point Integral rule
the integrand at time t and the integral over [t,t+dt].
St+dt = St + µSt
t+dt
t
du+
√
vtStσ
t+dt
t
dW1
u (4.6)
vt+dt = vt +κ(θ −vt)
t+dt
t
du+σ0
√
vt
t+dt
t
dW2
u (4.7)
obviously
t+dt
t
du = dt (4.8)
t+dt
t
dWu = Wt+dt −Wt = N(0,dt) =
√
dtZ(0,1) (4.9)
where Z(0,1) indicates a draw from standard normal distribution. Then the discretized
processes can be written as
St+dt = St + µStdt +
√
vtStσ
√
dtZS (4.10)
vt+dt = vt +κ(θ −vt)dt +σ0
√
vt
√
dtZv (4.11)
Where ZS and Zv are correlated ρ. Clearly judging from 4.10, vt can attain negative values.
Precisely probability of generating negative value of vt+dt is
P[vt+dt < 0] = φ
−(1−κdt)vt −κθdt
σ0
√
vt
√
dt
> 0 (4.12)
34. 4.2 Antithetic sampling 26
which is of course an issue since variance is non-negative. This is not a problem of the model
which is defined on a continuous space, rather a problem of the numerical method. A choice
of a more involved numerical scheme is possible as well as modelling volatility rather than a
variance and than take a square root. However noting that as dt → 0 the P[vt+dt < 0] → 0
we see that a choice of a very fine grid partially mitigates this problem. Indeed now we can
employ either full truncation scheme or a reflection scheme.
• Full truncation simply overrides negative variance with vt = 0
• Reflection scheme replaces every vt < 0 with |vt|.
This approach is flawed too as setting variance to zero is unrealistic for any stock and
reflecting large negative variance translates into large positive variance (i.e. period of very
low volatility translates into high volatility). However for our purposes and with a choice of
a very fine grid it is sufficient.
4.1.1 Simulating correlated RV
In 4.10 we have two standard normal random variables ZS and Zv correlated with rho. In
order to produce such correlation we follow
1. Simulate ⃗Z =
Z1
...
Zn
∼ N(⃗0,I)
2. Find C such that CCT = ∑ (e.g. by Choleski decomposition)
3. ⃗Y = CZ ∼ N(⃗0,∑)
in terms of simulating two RV with correlation ρthis translates into Zv = N(0,1) and ZS =
ρZv + 1−ρ2ZS.
4.2 Antithetic sampling
Antithetic sampling sometimes called antithetic variates method is a variance reduction
technique used in Monte Carlo simulations. Taking into account that statistical error has a
square root convergence, very large number of sample paths is needed in order to obtain an
accurate result. A motivating example for employing antithetic sampling is as follows.
35. 4.2 Antithetic sampling 27
Strike Heston Price MC Price Error Heston/MC Antithetic MC Error Heston/AntitMC
95 7.9841 7.9126 0.8951 7.9861 -0.0251
96 7.3090 7.2385 0.9645 7.3105 -0.0198
97 6.6661 6.5974 1.0298 6.6674 -0.0192
98 6.0563 5.9922 1.0590 6.0572 -0.0151
99 5.4805 5.4196 1.1110 5.4805 -0.0013
100 4.9392 4.8813 1.1715 4.9386 0.0111
101 4.4327 4.3793 1.2050 4.4315 0.0281
102 3.9611 3.9143 1.1814 3.9596 0.0373
103 3.5241 3.4825 1.1810 3.5201 0.1134
104 3.1212 3.0825 1.2395 3.1192 0.0628
105 2.7516 2.7143 1.3558 2.7517 -0.0031
106 2.4144 2.3799 1.4295 2.4171 -0.1100
107 2.1084 2.0749 1.5915 2.1136 -0.2452
108 1.8322 1.7965 1.9487 1.8396 -0.4011
109 1.5843 1.5494 2.2021 1.5926 -0.5228
110 1.3630 1.3322 2.2548 1.3706 -0.5576
Table 4.1 Error analysis
4.2.1 Example
Monte Carlo simulation is taking advantage of the law of large numbers. Suppose we want
to estimate
θ = E(Y)
and we have two generated samples Y1 and Y2. An unbiased estimator of θ is
ˆθ =
Y1 +Y2
2
And variance of such estimator is given as
Var( ˆθ) =
Var(Y1)+Var(Y2)+Cov(Y1,Y2)
4
this means that variance is lower if covariance is negative. Using this observation every time
we draw a sequence of random draws ε1,...ε2 we also take reflected draws −ε1,... − ε2
which results in the lower variance of the estimator thus increasing the accuracy. Table 4.1
shows and compares relative errors using plain Monte Carlo and Monte Carlo with Antithetic
sampling with Heston price obtained from semi-closed solution using Gauss-Laguerre.
This completes all three parts of the path generating engine. Now we are set to price path
dependent options.
37. Chapter 5
Results
Now utilizing parameters obtained in calibration in chapter 3 and the path generator developed
in chapter 4 we are set to price path dependent options with a payoff given by 4.1. We use the
path generator to generate N = 1 000 000 paths for every maturity with time step dt = Maturity
10000 .
The payoff on a discrete grid xi i ∈ [1,10000] is given by
callm(τ,K) =
1
10000
10000
∑
i=1
(Si)−K,0
+
(5.1)
putm(τ,K) = K −
1
10000
10000
∑
i=1
(Si),0
+
(5.2)
which gives a call/put price for one path given a predetermined strike price. Index m
represents mth path over which we calculate the payoff. In order to get a final price we take
the mean over all 1 000 000 paths and discount to the present. Final price is given by
Call(τ,K) = e−τ(r−q) 1
N
N
∑
i=1
calli (5.3)
Put(τ,K) = e−τ(r−q) 1
N
N
∑
i=1
puti (5.4)
where r is the risk free rate set to 0.34% as a 3 months US treasury yield and q is the
continuous dividend yield for S&P 500 set to 0.27% (source Bloomberg). The prices
calculated for a given volatility surface can be found in files AsianCall_1milPaths.xls and
AsianPut_1milPaths.xls. For an interested reader, we enclosed .m file with all 1 000 000 paths
generated for the S&P surface. Thus making calculation of an arbitrary exotic path dependent
option easy, as generation of 1 000 000 paths with a fine granularity takes over 10 hours.
Lastly, this work points out some of the drawbacks of using Heston characteristic function
38. 30
formulation. Further research would be needed for a thorough understanding of integrand
problems and how to bypass them. However, todays industry standards is apparently
Fundamental Fourier transform of the payoff and Lewis-Lipton formula.)This dissertation
comes with a zip file Mark_final_diss.zip which contains all code developed throughout this
project as well as all the mentioned .xlsx files.
39. References
[1] Atiya, A. and Wall, S. (2009). An analytic approximation of the likelihood function for
the heston model.
[2] Bakshi, Madan, K. (2000). Stock return characteristics skew laws and the differential
pricing of individual equity options. Michigan Math. J.
[3] Bjork, T. (2004). Arbitrage Theory in Continuous Time. Oxford University Press, second
edition.
[4] Chacon, P. (1991). Application of the fourier transform to probability theory and
stochastic processes. International journal of mathematical education, 22:695–705.
[5] Cox, J.C., J. I. and Ross, S. (1985). A theory of the term structure of interest rates.
Econometria, 53:385–407.
[6] Dupire, B. (1994). Pricing with a smile.
[7] Gatheral, J. and Taleb, N. (2006). The Volatility Surface: A Practitioner’s Guide. Wiley
Finance. Wiley.
[8] Hansjorg Albrecher, Philipp Mayer, W. S. J. T. (2005). The little heston trap.
[9] Heston, S. L. (1993). A closed-form solution for options with stochastic volatility with
applications to bond and currency options.
[10] John Hull, A. W. (Jun. 1983). The pricing of options on assets with stochastic volatilities.
The Journal of Finance, 42:281–300.
[11] Lewis, A. L. (2000). Option Valuation Under Stochastic Volatility: With Mathematica
Code. Finance Pr.
[12] MacKenzie, D. (2006). An Engine, Not a Camer:How Financial Models Shape Markets.
Cambridge, MA: MIT Press.
[13] Rouah, F. and Heston, S. (2013). The Heston Model and its Extensions in Matlab and
C#. Wiley Finance. Wiley.
[14] Rouah, F. D. (2013). Simplifed derivation of the heston model.
http://www.frouah.com/pages/.
[15] Whaley, R. (2006). Derivatives: Markets, Valuation and Risk Management. Hoboken,
NJ.
40. Appendix A
Multivariate Feymann-Kac
Suppose that⃗xt follow the n-dimensional stochastic process
d⃗xt =⃗µ(⃗xt,t)dt +σ(⃗xt,t)d⃗WQ
t (A.1)
where⃗xt and ⃗µ(⃗xt,t) are vectors in n dimensions, ⃗WQ
t is m-dimensional Brownian motion
and σ(⃗xt,t) is n×m matrix. The generator of the process is
A =
n
∑
i=1
µi
∂
∂xi
+
1
2
n
∑
i=1
n
∑
j=1
(σσT
)i,j
∂2
∂xi∂xj
(A.2)
Now PDE in V(⃗xt,t)
∂V
∂t
+A V(⃗xt,t)−r(⃗xt,t)V(⃗xt,t) = 0 (A.3)
with boundary condition V(⃗xT ,T) has solution given by
V(⃗xt,t) = EQ
[e− T
t r(⃗xu,u)du
V(⃗xT ,T)|Ft] (A.4)
41. Appendix B
Gauss-Laguere quadrature
Gauss-Laguerre is a quadrature rule for approximating integrals of the kind
∞
0
e−x
f(x)dx ≈
n
∑
i=1
ωi f(xi) (B.1)
where xi is the i-th root of Laguerre polynomial LN and weights ωi are defined as
ωi =
xi
(n+1)2[Ln+1(xi)]2
(B.2)
LN(x) =
N
∑
k=0
(−1)k
k!
N
k
xk
(B.3)