Fourier Transform Methods in Option Pricing
Fourier Transform Methods in Option Pricing
22 May 2009
Submitted in partial fulfillment of a postgraduate diploma at AIMS
Abstract
In this essay, we presented a very fast and efficient method for pricing option. The method have been
introduced by Peter Carr and Dilip Madan in 1999 to compute the option price numerically by using
the fast Fourier transform. Based on the Black-Scholes model, we computed the European call option
price numercally by modifying the option price function to enforce integrability and we calculated its
Fourier transform by using the characteristic function of the underlying asset. By formulating an analytic
expression of the Fourier transform of the modified value, we obtained the call price by Fourier inversion.
We compared the analytic form of the option value under the Black-Scholes with the numerical one. We
do not consider the analytic solution of the Variance Gamma because of the complexity of the algebra
involved but we observed graphically that the magnitude of the error introduced by Fourier pricing under
the Black-Scholes for which the fair price is known analytically is less than one percent.
Declaration
I, the undersigned, hereby declare that the work contained in this essay is my original work, and that
any work done by others or by myself previously has been acknowledged and referenced accordingly.
Contents
Abstract
1 Introduction
1.1
1.2
Theory of Arbitrage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 Mathematical Models
2.1
2.2
2.3
Basic Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.1
2.1.2
2.1.3
. . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.4
Payoff Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.5
It
os Lemma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2.1
2.2.2
2.2.3
2.2.4
2.3.2
2.3.3
The VG Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3.4
19
3.1
3.2
3.3
3.3.2
3.3.3
Discrete Approximation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
ii
3.3.4
3.3.5
4 Application
27
4.1
4.2
4.3
30
31
References
36
iii
1. Introduction
Option pricing is one of the most important areas in financial mathematics and incorporates many
different disciplines in mathematics. One such example is the use of the Fourier transform.
In finance, an option is a contract between a buyer (holder) and a seller (writer) that gives the buyer
the right-but not the obligation-to buy or to sell a particular asset (the underlying asset) on a prescribed
day at an agreed price. In return for granting the option, the seller collects a payment (the premium)
from the buyer. A call option gives the buyer the right to buy the underlying asset; a put option gives
the buyer of the option the right to sell the underlying asset. If the buyer chooses to exercise this right,
the seller is obliged to sell or buy the asset at the agreed price. The buyer may choose not to exercise
the right and let it expire. According to this definition, the asset in which the transaction may take
place is known as the underlying. The prescribe date is called the maturity time or expiry. And the price
at which the buyers may purchase or sell the underlying is called the exercise price or strike price.
The history of options dates back to hundreds of years ago. Paul Wilmott [WHd95] mentioned the
stories of Thales in Greece who used the ancient type of options to secure a low price for olives in
advance of the harvest. In The Netherlands, trading in tulip derivatives blossomed during the early
1600s. Although options were originally traded in the `over-the-counter(OTC) market, where the
terms of the contract were customised or negotiated, option trading really took off when the first option
exchange, the Chicago Board Options Exchange (CBOE) was organized in 1973 to trade standardised
contracts, which greatly increased the market and liquidity of options. Trading in put options began
later in 1977. Nowadays, the option market has grown to be so huge, that the size of the (OTC) market
had reached $596 trillion by the end of June 2007 [BfIS09].
Usually, options have two primary usages, speculation and hedging. Speculative investors trade the
options to make profit according to their judgments on the trends of the asset prices. For example, such
an investor will choose to buy a call option if he thinks the underlying price is going to increase in the
following months. If his forecast is correct, he makes money, otherwise he loses money. By contrast to
buying the stock share, options can be a cheap way for investment when the stock price is much higher
than the cost of the option. Hedging happens when investors want to minimize the risk that they may
be subjected to because of the unpredictable events in the financial market, i.e. due to the random walk
of the underlying price. In the market, asset holders can choose to buy put options if they think that
the asset price is going to fall. If they are correct, the profit they make from the options will reduce
the loss due to holding the asset. Therefore, this hedging strategy becomes an insurance against the
adverse movements in the underlying.
In the financial market, options are classified into different categories according to the elementary
concepts which make up those options. If the option gives the buyer the right to buy the underlying, it
is a call option. By contrast, it is a put option if the buyer has the right to sell the underlying at (or
by) the expiry. American options enable the buyers to exercise them before the expiry, and European
options can only be exercised at the expiry. Call and put options are known as the plain vanilla options
because they are basic. There are also some other complicated types of options. Asian options strike
prices are prescribed as some form of the average of the underlying prices over a period. Lookback
options depend on the maximum or minimum price. Barrier options can either come into existence or
become worthless if the underlying asset reaches some prescribed value before expiry. Such complicated
options, as Asian, lookback and barrier options are usually called exotic options.
Because options offers their buyers some privileges, they have some value. An options value should
Page 2
be equal to its price when traded in the market, otherwise the arbitrage opportunity will appear. A
correct mathematical valuation of the option value is thus one of the targets in the research on options.
Roughly speaking, an options value is influenced by many factors. For example, a European call option
will have a positive value if the underlying assets price is higher than the strike price, otherwise it may
be profitless. Time to expiry plays also a role. An option with an expiry of 6 months has more value
than one which will expire tomorrow, because the underlying price may have more potential to change
over a longer period. There are also many other factors, such as the options type, the bank interest
rate, dividends and so on, which may influence an options value. The relationship between those factors
and the option value is described differently in various models.
In the theory of option pricing, there are some assumptions for modelling. There is no market friction,
no default risk and no arbitrage. This means: no transaction costs, no bid/ask spread, perfect liquid
markets, no taxes, no margin requirements, no restrictions on short sales, no transaction delays, market
participants act as price takers, market participants prefer more to less. The bank interest rate is
assumed to be fixed in short-term and does not change. The basic theory says, if the interest rate is r
and an amount of money B is deposited at time 0, its value will be Bert at time t > 0. Equivalently,
if we borrow Bert currency units, we will have to pay back B currency units at time t later.
Many assets, such as equities, pay out dividends. The dividends can be seen as the payments to the
shareholders out of the profits made by the company. The likely dividend stream of a company in the
future is reflected by its current share price. But for the purpose of this works dividends will not be
considered.
This essay is focused on 2 different problems in quantitative finance. The first one is how to apply
the Fourier transform introduced by Carr and Madan [CM99] when computing option prices with the
Fourier transform method based on the Black-Scholes model and how to deduce the option pricing for
the Variance Gamma model. The second problem is to compare the analytic solution to the numerical
one and plot some of the result in order to appreciate the curve of the option price of both models.
Chapter 2 introduces the mathematical models and methods frequently applied in option pricing. In
chapter 3, we present the numerical valuation method a Fast Fourier transform. In chapter 4, the
implementation details and some plots results are presented.
1.1
We will introduce some important notations which we use throughout this essay. The option value
is denoted by V . To make the distinction between call and put options value, C and P are used
respectively. To show that the option value is a function of the current value of the underlying asset
price S and time, t, V is sometimes denoted as V (S, t). In general, standard option valuation models
depend on the following factors:
S, the current market price of the underlying asset;
, the volatility of the underlying asset or an estimate of the future volatility of the underlying
assets price over the life of the option;
K, the exercise or the strike price of the option, particularly in relation to the current market price
of the underlier;
Page 3
T , the expiry date or the time to expiration together with any restrictions on when exercise may
occur;
r, the interest rate;
The mathematical model follow the following assumptions [Ber07]:
1. No market friction: In the real world there are brokers, spread, taxes, margin requirements and so
on. We do not consider these factors at all when giving a fair price for an option.
2. No dividends: for example many stocks regularly payout to thier stockholders. Though obviously
unrealistic, this assumption is fairly easily relaxed. For the purposes of this work, dividend will not
be considered.
3. No arbitrage: This assumption is central to the modelling of market price. It is simply says that
one cannot make a risk-free profit off the market. If for example, one were able to derive some
method for making risk-free profits, it would be impossible for the market to be in equilibrium.
We know this is not the case. Mathematically, the no arbitrage assumption provides us with a risk
neutral probability measure, generally denoted Q. It is because of the no arbitrage assumption
that mathematical option pricing is often termed risk-neutral valuation.
4. Greed: Market participants want more money to less. This is probably the weakest assumption
that the reader has encountered to date.
1.2
Theory of Arbitrage
Before moving on the mathematical model, lets introduce one of the most important theory in option
pricing [Gho09b]:
Definition 1.2.1. An arbitrage opportunity is the possibility to make a profit in a financial market
without risk and without net investment of the capital.
The principle of no arbitrage states that a mathematical model of a financial market should not allow
for the arbitrage possibilities.
A Portfolio or Trading Strategy is a pair of units (a, b) R2 such that
a unites of the risky-asset
b unites of the risless (or risk-free) asset.
2. Mathematical Models
2.1
2.1.1
Basic Concept
The Mathematics Elements
Lets consider a (, F) where is the sample space (non-empty set ) of the random variable, containing
all scenario (events) and F is a -field or a collection of subsets of and where A F is the event.
The following definitions are obtained from [Gho09a].
Definition 2.1.1. A -field F is a family of subsets of such that:
The empty set is contained in F; F
For all A F, then Ac F
F is closed under the operation of countable unions; If A1 , A2 , ... F then
n>1 An
F.
Definition 2.1.2. A filtration or informations flow on a time interval, say [0, T ], denoted {F}t[0,T ] on a
probability space (, F, P) is an increasing sequence of -fields containing information on the evolution
of the price process up to time T such that, for all 0 s t then Fs Ft F.
A probability space (, F, P) equiped with a filtration is called a filtered probability space and is denoted
(, F, {F}t[0,T ] , P).
Definition 2.1.3. Given a filtered probability space (, F, {F}t[0,T ] , P) where {F}t>0 is the natural
filtration, A stochastic process is a family of P, {F}t0 -adapted reals valued functions indexed by time,
Xt[0,T ] on . {Xt }t[0,T ] is adapted to {F}t[0,T ] if {Xt }t[0,T ] is Ft -mesurable. For each realisation
of randomness , the trajectory X() : t Xt () defines a function of time and is called a sample
path. More formally, A stochactic process is a function
X : [0, T ] 7 F.
It follows that stochastic processes are random functions taking values in functions spaces.
Definition 2.1.4. Given a filtered probability space (, F, {F}t[0,T ] , P), the sequence of random
variables {Xt }t>0 is a Martingale with respect to P and the filtration {F}t>0 if for all 0 6 s 6 t:
E [|Xt |] < for all t
EP [Xt /Xs ] = Xs
Otherwise,
{Xt }t>0 is a P-super-martingale if EP [Xt /Xs ] Xs and a P-sub-martingale if EP [Xt /Xs ] Xs .
Definition 2.1.5. A stoschastic process {Xt }t>0 with its natural filtration {F}t>0 is a Markov process
if for all 0 6 s 6 t:
P (Xt+s A/Ft ) = P (Xt+s A/Xt )
4
for all
A F.
2.1.2
Page 5
2.1.3
In the research on option pricing, the dynamics of the asset price is usually represented by its relative
change, dS/S, called return. The most common model, the geometric Brownian motion model (GBM),
says that the return of the asset price is made up of two parts as [WHd95].
dS
= dt + dB
S
(2.1)
where , known as the drift, marks the average rate of growth, and is called volatility that keeps the
information of the standard deviation of the return. The first part dt reflects a predictable, deterministic
Page 6
and anticipated return which is similar to the return of investment in banks. The second part dB
simulates the random change in the asset price in response to external effects, such as uncertain events.
The quantity dB contains the information of the randomness of the asset price and is known as the
Wiener process or Brownian motion. It is a random variable which follows anormal distribution, with
mean zero and variance dt. This means that dB can be written as dB = dt. Here is a random
variable with a standardized normal distribution. Its probability density function is given by
1 2
1
(2.2)
f () = e 2
2
for < < +. With the definition of the expectation
Z +
1 2
1
E[F (.)] =
F ()e 2 d.
(2.3)
2
For any function F , we have
E[] = 0,
E[2 ] = 1.
The stochastic differential equation (2.1) has the unique solution given by
2
St = S0 exp ( )t + Bt .
2
This functional of Brownian motion is called geometric Brownian motion. The geometric Brownian
motion model, and the log-normal distribution in equation (2.24), are the basis for the Black-Scholes
model for stock-price dynamics in continuous time. In figure 2.2 one see the realization of the geometric
Brownian motion based on the sample path of the standard Brownian motion.
Figure 2.2: A sample path of the Geometric Brownian motion S0 = 100, = 0.4, r = 0.05
2.1.4
Payoff Function
The value of an option at its expiry is usually called the payoff function. For a European call option
with a strike price K, the payoff is [WHd95]
C(ST , T ) =
ST K,
0,
if
ST > K,
(2.4)
otherwise.
This can also be written more concisely as max(ST K, 0), or (ST K)+ . In the case of ST > K,
the option is called in the money. It is said to be out of the moneyif ST < K. If ST = K, it is at
the money. Similarly, the payoff function is (K ST )+ for a European put option.
2.1.5
Page 7
It
os Lemma
In practice, stock prices are discrete values at discrete time points. Changes can be observed only when
the exchange is open. Nevertheless, the continuous-variable, continuous-time processes prove to be
useful models for many purposes. To value an option, it is necessary to set up the mathematical models
in the continuous time limit dt 0 and it is more efficient to solve the resulting differential equations,
rather than to simulate the random walk on a practical time scale. Therefore, it is needed to handle the
dB term in equation (2.1) as dt 0. In [WHd95], Itos lemma provides a type of machinery as
f
f
f
1 2 2 2f
df = S
+
dt
(2.5)
dB + S
+ S
S
S 2
S 2
t
where f is a function of S. Because logarithmic asset prices are widely used, the differentiation of
f (S) = log(S) gives
f
1
2f
1
=
and
= 2
S
S
S 2
S
which leads to
1
(2.6)
df = dB + ( 2 )dt.
2
Equation (2.6) is a constant coefficient stochastic differential equation, which says that the difference df
is normally distributed. Consider f itself: it is the sum of the jumps df (in the limit, the sum becomes
an integral). Since a sum of normal variables is also normal, f f0 has a normal distribution with mean
( 12 2 )t and variance 2 t, where t is the time elapsed between f and f0 , and f0 = log(S0 ) is the
initial value of f . The probability density function of f (S) is given by
1 2
1
2
2
e((f f0 )( 2 )t) /2 t
2t
(2.7)
(2.8)
2.2
2.2.1
The most famous model in option pricing is the Black-Scholes model. It is based on the GBM (geometric
Brownian motion) model of asset prices: dS/S = dt + dBt where and are fixed values during the
lifetime of the option, and dBt is the Brownian process. According to Itos lemma and the Arbitrage
theory, a partial differential equation can be obtained by means of setting a portfolio and eliminating
the random items by hedging.
Consider a market with a share St whose price process satisfies the SDE. We have the following stochastic
differential equation
dSt = St dt + St dBt .
(2.9)
Page 8
Considering the risk-free interest rate r, and the riskless bank account At , the dynamics of the asset
price is defined as following:
dAt = rAt dt.
(2.10)
Let V (t, St ) be European style derivative whose value depends on both the share price and the time.
Consider a portfolio which contains 1 derivative, and n shares, i.e. its value is
t = Vt + nSt .
(2.11)
A small amount of time dt later, the share price has changed. The value of the portfolio changes by
dt = dVt + ndSt .
(2.12)
(2.13)
Therefore,
2
V
V
V
1 2 2 V
+ n dBt + S
+ 2 S
+
+ nS dt
S
S
S 2
t
2
V
V
V
1 2 2 V
+ n dBt + S
+ n + 2 S
+
dt.
S
S
S 2
t
dt = S
(2.14)
= S
V
V
(i.e. the portfolio is short
shares), then the portfolio is unaffected by the
If we take n =
S
S
random changes in stock prices:
dt =
2
1 2 2 V
S
2
S 2
V
+
t
dt,
(2.15)
Thus, for a brief moment, the portfolio is risk-free. By a no-arbitrage argument, it must earn the same
return as the risk-free bank account. This means that
V
dt = rt dt = r V S
dt.
(2.16)
S
By putting together equations (2.15) and (2.16), we obtain
V
1
2V
V
+ 2 S 2 2 + rS
rV = 0.
t
2
S
S
(2.17)
This is the famous Black-Scholes PDE. It is a second-order parabolic PDE, i.e. essentially a heat
equation. Consider a European call option C on a share S with strike K and maturity T . The volatility
of the underlying share S is and the risk-free rate is r. To find the value of the call option, we must
solve the following boundary value problem:
Page 9
C
V
2C
+ 21 2 S 2 2 + rS
rC = 0,
t
S
S
2.2.2
(2.18)
To compute the Black-Scholes prices of vanilla European options, we use a slightly subtle probabilistic
argument, rather than a brute force to solve the PDE approach.
Same as equation (2.17), we deduced the Black-Scholes PDE for a European-style derivative V :
V
1
2V
V
+ 2 S 2 2 + rS
rV = 0.
t
2
S
S
(2.19)
It is important to remark that the drift does not occur in the Black-Scholes PDE, though the volatility
does appear. Hence, the price of V is independent of , i.e. different values of will give the same
price. Since we do not need the drift rate of an underlying asset, we may as well simplify our asset
price dynamics by assuming that all assets have the same drift. Now the riskless asset (bank account)
has drift r, and r occurs in the Black-Scholes PDE. We can not change the drift of the risk-free bank
account without changing the PDE, and thus the solution to the pricing problem. So, if we want to
assume that all assets have the same drift, we have to assume that the drift of all assets is the riskfree rate r. Mathematically, this corresponds to a change of measure from the real world, unknowable
probability measure P to a knowable, risk-neutral measure Q. In the risk-neutral world, the dynamics of
S are
dSt = rSt dt + St dBt .
(2.20)
Thus, we change the drift of the asset from to r. Thus, in a world where all investors are risk-neutral,
all assets will have the same expected return, i.e. the same expected return as the risk-free bank account.
To summarize, prices in the real and risk-neutral world are the same. It is just probabilities that are
changed. Now we can calculate option prices in the risk-neutral world, because the asset price dynamics
are known, and so is the distribution of future stock prices. Now suppose that we can find a portfolio
of traded assets which exactly hedges the payoff of a European style derivative V , so that
t = Vt
at the derivatives maturity T . Such a portfolio is called a replicating portfolio. By the Law of One
Price, therefore, we must have 0 = V0 , where 0 and V0 are, respectively the values of the replicating
portfolio and the derivative at t = 0. Thus:
If a derivative has a replicating portfolio, then the value of the derivative equals the value of the
replicating portfolio.
Now in the Black-Scholes model, as in [Ouw08], any European style derivative has a replicating portfolio:
A portfolio consisting, at any time, of = V
S shares will exactly replicate the derivative V (delta
hedging). T and VT are random variables. But since they are identical, they must have the same
Page 10
expectation, in any world. Since the expected return of all traded assets is r in the risk-neutral world,
and since consists entirely of traded assets, the expected return of is also r:
ERN [T ] = 0 erT ,
(2.21)
where 0 is the value of the portfolio at t = 0. Since 0 = V0 (by the Law of One Price) and T = VT
(because 0 is a replicating portfolio of V ) as in [Ouw08], we see that
V0 = erT ERN [T ] .
(2.22)
The point is that we cant calculate Ereal [VT ], because we do not know the distribution of the underlying
ST in the real world. However, we can calculate ERN : Since we know the drift of ST in the risk-neutral
world, we can calculate the distribution of ST here. This brings us to our next topic.
2.2.3
Let St be the asset price described in subsection 2.2. Considering the function Yt = f (St ) = ln St , we
deduce from equation (2.6) that
1
dYt = dBt + ( 2 )dt,
2
(2.23)
by using the fact that (dBt )2 = dt and (dt)2 = dBt dt = 0. YT follow a Brownian motion with a drift.
By solving equation (2.23), we obtain
1
YT Y0 = BT + ( 2 )T,
2
(2.24)
2
1
1
(ln
y
exp
,
2 2
2 2 y
fY (y) =
0,
if
y>0
(2.25)
if
y 0.
Y = eX + 2 X ,
Y2 = e2X +X [eX 1 ].
(2.26)
In order to give the explicit solutions to the Black-Scholes equation for European call and put options,
we need to state the following thoerem as in [Ouw08].
Page 11
ln [E(Y )/K] 12 s2
s
Z x
1 u2
e 2 du.
N (x) =
2
d =
N (.) is the cumulative distribution function for a standardized normal random variable.
ln Y m
,
s
and X N (0, 1), i.e. X is a standard normal random variable. Clearly
ln K m
m ln K
ln K m
=1N
=N
P(Y K) = P (ln Y ln K) = P X
s
s
s
where N (x) is the distribution function of a standard normal random variable,
and we used the fact that 1 N (x) = N (x).
1 2
ln ym
,
s
E [max {Y K, 0}] = E max esX+m K, 0 =
(esx+m K)g(x)dx
ln Km/s
esx+m g(x)dx
I=
(ln Km)/s
and
J = K
g(x)dx.
(ln Km)/s
Page 12
2 /2
g(x s)
= E [Y ] g(x s).
We use the fact that, E [Y ] = e
Z
I=
m+s2 /2
, where I becomes
esx+m g(x)dx = E [Y ]
g(x s)dx
(ln Km)/s
(ln Km)/s
R
and a g(x s)dx is just the probability that a standard normal random variable is greater than a s,
which is N (s a) = 1 N (a s). Thus,
Z
ln K m
sx+m
I=
e
g(x)dx = E [Y ] N
= E [Y ] N (d+ )
s
(ln Km)/s
using m = ln E [Y ] 12 s2 .
Similarly,
Z
J = K
g(x)dx = KN (d )
(ln Km)/s
.
Now, lets consider the result given by equation (2.24). We have
1
Yt Y0 = Bt + ( 2 )t,
2
where
Bt N (0, t)
implies that
1 2
2
Y0 + ( )t, t ,
2
1 2
2
ln S0 + ( )t, t .
2
Yt N
which means that
ln St N
2 ) and
Thus, St = eX where X N (X , X
= ln S0 + ( 21 2 )t
(2.27)
2
X
2t
0 S < +,
(2.28)
Using equations (2.26) and (2.27), it follows that the expectation of St is given by
1
E [St ] = eX + 2 X = S0 et .
Replacing with r will give the density of St in the risk-neutral world.
(2.29)
2.2.4
Page 13
Having the density function of the asset price St (equation (2.28)) in the risk-neutral world, we can
price practically any European claim V with payoff (St ):
Vt = er(T t) ERN [(ST )]
(2.30)
=
er(T t)
R +
0
(S)f (S)dS.
Now, let us consider a call option C with strike K and maturity T . In this case, (ST ) = max {ST K, 0}.
Thus:
Ct = er(T t) ERN [(ST )]
(2.31)
r(T
t)
= e
ERN [max {ST K, 0}]
However, in the risk-neutral world, ST is log-normally distributed, with ln St N ln S0 + (r 21 2 )t, 2 t .
According to theorem 2.2.1, it follow that
ERN [max {ST K, 0}] = ERN (ST )N (d+ ) KN (d )
where
ln [E(ST )/K] 12 2 (T t)
d =
,
T t
(2.32)
ln S0 erT /K 21 2 (T t)
d =
,
T t
(2.33)
and N (x) is the distribution function of a standard normal random variable, i.e.
Z x
u2
1
e 2 du.
N (x) =
2
2.3
2.3.1
The Variance Gamma (VG) process is a pure jump model, and their three parameters , , take into
account the variance, skewness and kurtosis of the price process [Sch08].
We note that the skewness measures the degree to which a distribution is asymmetric and is defined to
be the third moment about the mean, divided by the third power of the standard deviation:
E (X X )3
.
V ar[X]3/2
Page 14
For a symmetric distribution (like the N (, 2 )), the skewness is zero. Tail behavior and peakedness
are measured by kurtosis, which is defined by
E (X X )4
.
V ar[X]2
For the Normal distribution (mesokurtic), the kurtosis is 3. If the distribution has a flatter top (platykurtic), the kurtosis is less than 3. If the distribution has a high peak (leptokurtic), the kurtosis is greater
than 3.
Specifically, the VG process is obtained as a Brownian motion (BM) with drift evaluated at a random
time (t):
Xt = (t) + B(t) ,
(2.34)
where Bt is a standard BM and (t) a gamma process evaluated at t. The BM requires no further
explanation, we can see subsection 2.1.2 for more informations. The gamma process is an infinitely
divisible one, obtained by adding independent increments which follow a gamma random variable.
2.3.2
The Gamma distribution is a distribution that lives on the positive real numbers and dependents on two
parameters a and p. The density function of a random gamma variable of parameters (a, p) is given by:
f(t) (x) =
ap p1 ax
x e ,
(p)
x > 0,
(2.35)
R
where (x) = 0 tx1 et dt is the gamma function. This implies that, (t) is a non-decreasing process
distributed as a gamma random variable of parameters a = 1/, p = t/, and may be approximated as
a compound Poisson process. It may also be described by means of its characteristic function, univocally
obtained by the inverse Fourier transform of the density function given above, see equation (2.35):
t/
1
(t) (x) =
.
1 iu/
As an infinitely divisible process, it may also be characterised by means of its Levy measure:
e x
2
dx,
x
k (x)dx =
0,
if
(2.36)
x > 0,
(2.37)
if
x 0.
The integral of this function is infinite, so the gamma process has infinite activity. As k(0) is also
infinite, the measure is concentrated near the origin. The coefficient of the diffusion term u2 /2 in the
Levy-Khintchine representation of its characteristic function is zero, and the process is a pure jump one.
See figure 2.3
2.3.3
The VG Distribution
By evaluating a BM with drift at a gamma random time, we obtain the (Variance Gamma) VG process.
Its density function is not as simple as in the gamma process, but its characteristic function and Levy
density are.
Page 15
1
1 iu + ( 2 /2)u2
t/
(2.38)
The VG process can be expressed in an alternative form. It consists of expressing it as the difference
of two gamma processes. The Variance Gamma VG(C, G, M ) distribution on (, +) can be
constructed as the difference of two gamma random variables. Suppose that X is Gamma(a = C, b =
M ) random variable and that Y is Gamma(a = C, b = G) random variable and that they are independent
of each other. Then
X Y V G(C, G, M ).
To derive the characteristic function, we start with noting that
X (u) = (1
iu C
)
M
Y (u) = (1
and
iu C
) .
G
GM
GM + (M G)iu + u2
C
,
1
,
r
G
r
M
Page 16
2 2 2 2
4
2
2
!1
2 2 2 2
+
+
4
2
2
!1
Another way of introducing the Variance Gamma (VG) distribution is by mixing a Normal distribution
with a Gamma random variate. The procedure goes as follows: Take a random variate G Gamma(a =
1/, b = 1/). Then sample a random variate X Normal(G, 2 G), then X follows a Variance Gamma
distribution. The distribution of X is denoted VG(, , ) and thus depends on 3 parameters:
a real number (in the mean of the Normal distribution)
a positive number (in the variance of the Normal distribution)
a positive number (of the Gamma random variable G).
One can show using basic probabilistic techniques that under this parameter setting, the characteristic
function of the VG (, , ) law is given by
E[exp(iuX)] = V G (u; , , ) = 1 iu + 2 u2 /2
1/
1
,
C
2 =
2C
,
MG
C(G M )
.
MG
(G M )x
2
|x|
G+M
C1/2
KC1/2
(G + M )|x|
2
,
where K (x) denotes the modified Bessel function of the third kind with index and (x) denotes the
gamma function. For more informations, see [Sch08].
The VG has been described and characterised. Now we introduce the statistical and the risk-neutral
price dynamics. See figure 2.4 for the VG process path.
Page 17
2.3.4
This section describes the statistical and risk neutral dynamics of the stock price in terms of the VG
process. See figure 2.5 for VG stock price process. We will not derive the closed forms for the return
density and the prices of European options on the stock. The analytic form of the fair price under the
VG is prohitively complicated and will not be considered. This closed form has a disadvantage. The
functions involved, expressible as power series, are computationally expensive. Calculating the call price
using the analytic form is slower than computing the price numerically. Carr-Madan [CM99] transform
the integral in equation (3.15) in such a way that option prices may be performed by FFT. It leads to
a much faster solution than using the closed form. The new specification for the statistical stock price
dynamics is obtained by replacing the role of Brownian motion in the original Black-Scholes geometric
Brownian motion model by the VG process. Let the statistical process for the stock price be given by
St = S0 exp(rt + t + Xt (, , )),
where Xt is a VG process, r is the continuously compounded interest rate under the risk neutral process
and is the convexity correction calculated by evaluating the characteristic function at i, in this case
resulting
1
1
ln(1 2 ).
2
The characteristic function of the VG is reads
=
T (u) =
(2.39)
Page 18
Figure 2.5: A sample path of the VG stock price,S0 = 100, = 0.1, r = 0.04, = 0.1, = 0.2
3.1
In this section, we state how most authors e.g. Bakshi and Madan [BM97] and Scott [Sco97] have
applied Fourier analysis to determine option prices. Consider a European call option of an underlying
asset whose terminal spot price is ST of some underlying asset. The characteristic function of sT = ln ST
is defined by
T (u) = E eiusT
where E is the expectation. Assuming the characteristics function was known analytically, Bakshi and
Madan [BM97] and Scott [Sco97] calculated the risk neutral probability of finishing in-the-money as
!
Z
1 1 +
eiu ln(K) T (u)
Pr (ST > K) = 2 = +
Re
du
2 0
iu
where k = ln K is the log of the strike price. The delta function is numerically obtained as
!
Z
1 1 +
eiu ln(K) T (u i)
1 = +
Re
du.
2 0
iuT (i)
Considering a constant riskless rate r and no dividends, the option values is now calculated as
C = S1 KerT 2 .
But in this method, the FFT cannot be applied to evaluate the integral due to the restriction of the
integrand to its real part. Further discussion of FFT for option pricing as developed by Carr and Madan
[CM99], is presented separately in next section since one of our aims is to use their model in order to
price option with FFT algorithm.
3.2
Here we start with the description of a very efficient pricing technique. According to equation (2.30),
the solution of the Black-Scholes equation (2.19) has a solution of the form
19
Page 20
V (t, S) = er(T t) EQ
t [(T, S)]
(3.1)
where T is the maturity time and Q is the risk-neutral measure. This equation can be written as an
integral:
R +
(3.2)
V (x, T ) = er(T t) (xT )f (xT |x)dxT
where x is the logarithmic asset price, (xT ) = ((exT K))+ is the payoff function, ( = 1 (call) or
= 1(put)) at maturity and f (xT |x) is the transition probability density of reaching x(T ) from x(t).
The transition probability density function is usually difficult to be found analytically, whereas its Fourier
transform, called the characteristic function, is comparatively easy to be obtained, by means of the
moment generating function. The characteristic function reads
Z +
0
eiws f (s)ds.
(3.3)
f = F(f ) =
Therefore, it is convenient to switch the computation to the frequency domain with the help of the
characteristic function to solve the option pricing problems. The characteristic function of the logarithmic
asset price in the Black-Scholes model [WHd95] is given by
T (w) = E eiwsT ,
equivalent formulation yield
1
T (w) = eiw1 2 1 w ,
(3.4)
where 1 = (r 21 2 )t and 1 = t .
3.3
Equation (3.2) shows a general form of a representation of option prices. Once we know the characteristic
function, we can transform the computation from the asset price domain to the frequency domain. The
reason why we do it this way is that, characteristic functions are easier to obtain than the density
functions themselves.
3.3.1
For the Black-Scholes model, the transition probability density is the same as the density probability,
where f (xT |x) = f (z) with z = xT x. As a result, equation (3.2) becomes
R +
V (x, T ) = er(T t) (T, xT )f (xT x)dxT
(3.5)
R +
r(T
t)
= e
(T, z + x)f (z)dz.
We then apply the Fourier transform on V (t, x), with the damping factor ex to ensure the existence
of the Fourier transform,
Page 21
(3.6)
iwx
Z
Z + Z +
i(wi)(yz)
=
e
(t, y)dy f (z)dz
=
Z + Z +
i(wi)x
Z +
(3.7)
(3.8)
(3.9)
i(w+i)z
f (z)dz
(3.10)
(3.11)
(3.12)
where is the damping factor, f () is the characteristic function, V () is the Fourier transform of
0
V (x, T ) and () is the Fourier transform of the payoff function. With the transformation, we can
compute the right handside of equation (3.12) and then get the options value by performing the inverse
Fourier transform.
3.3.2
In the Carr and Madan model, the technique [CM99] assumes that the characteristic function of the
risk-neutral density is known analytically. Given any such characteristic function, we develop a simple
analytic expression for the Fourier transform of the option value or its time value. We then use the
FFT to numerically solve for the option price or its time value. Further basic ideas on the use of FFT
for pricing problems are described by Cerny [Cer04]. Financial engineers use Fourier analysis to identify
cyclic patterns in asset price movements. Such processes can either be described in the time domain by h,
which is a function of time h(t), or in the frequency domain where the process is specified by frequency f ,
that is H(f ), with < f < +. One goes back Rand forth between the representations
by means of
R +
+
the continuous Fourier transform equation H(f ) = h(t)e2if t dt and h(t) = H(f )e2if t df ,
or the discretized form given by
H(f ) =
h(t) =
N 1
1 X
h(t)e2if t/N ,
N
(3.13)
1
N
(3.14)
t=0
N
1
X
t=0
Since the call value is a function of the strike price, by approximately mapping call value and strike
price to the above equations, we can apply the Fourier transform to the option pricing problem. The
characteristic function is given by
Page 22
T (u) = E eiusT =
Let CT (k) be the fair price of a T maturity call option with strike K = ek , on an underlying asset St .
Let qT (s) denote the PDF of sT = log ST , and T (u) denote the corresponding characteristic function.
Since the fair price CT (k) is simply the present value of the expected payoff, we have:
Z +
CT (k) = exp(rT )
(es ek )qT (s)ds.
k
eivk cT (k)dk.
T (k) =
We write the call price function given by Carr and Madan [CM99] as
CT (k) =
exp(k)
eivk T (v)dv,
(3.15)
eivk cT (k)dk,
T (v) =
Z +
Z +
ivk rT
rT
Z
qT (s)
(3.17)
(3.16)
ds,
+ iv
1 + + iv
(3.18)
erT qT (s)
(3.19)
which leads to
T (v) =
=
=
erT T (v ( + 1)i)
,
2 + v 2 + i(2 + 1)v
erT T (v ( + 1)i) (2 + v 2 ) i(2 + 1)v
,
(2 + v 2 + i(2 + 1)v) ((2 + v 2 ) i(2 + 1)v)
erT T (v ( + 1)i) (2 + v 2 ) i(2 + 1)v
.
((2 + v 2 )2 + (2 + 1)2 v 2 )
(3.20)
(3.21)
(3.22)
T (v) is odd in its imaginary part and even in its real part. Here k is the log-strike price K (k = log K)
and is identified to t in (3.14) [TT03]. That is, the price needs to be computed at various strike prices
Page 23
of the underlying assets in the option contract. Furthermore, v correspond to f , T (v) is the Fourier
transform of the call price CT (k), and T is the Fourier transform of qT (s), the risk-neutral density
function of the pricing model. The integral on the right hand side of equation (3.15) is a direct Fourier
transform and lends itself to the application of the FFT in the form of summation given by equations
(3.13) and (3.14).
3.3.3
Discrete Approximation
We wish to turn equation (3.15) into a form suitable for an FFT algorithm. That is, both CT (k) and
the integral must be discretized. This implies that the integral need to be truncated. If I = ek /
and = ei , then
vk T (v)dv.
CT (k) = I
(3.23)
If vj = j and the trapezoid rule are applied to the right handside of equation (3.23), then CT (k) can
be written as
CT (k) = I
N
1
X
vj k T (vj ),
j = 0, ..., N 1,
(3.24)
j=0
where the effective upper limit of integration is N and vj corresponds to various prices with spacing.
In general, the strikes near the spot price are of interest because such options are traded most frequently.
We thus consider an equidistant spacing of the log-strikes around the log spot price s0 :
1
ku = N + u + s0 ,
2
u = 0, ..., N 1,
(3.25)
where > 0 denotes the distance between the log strikes. Substituting these log-strikes yields, for
u = 0, ..., N 1:
CT (k) =
N 1
exp(ku ) X iju i( 1 N s0 )vj
T (vj ),
e
e 2
j = 0, ..., N 1.
(3.26)
j=0
j = 0, ..., N 1
(3.27)
provided that
2
.
N
(3.28)
This constraint leads, however, to the following trade-off: The parameter N controls the computation
time and thus is often determined by the computational setup. Hence, the right handside may be
Page 24
regarded as given or fixed. One would like to choose a small in order to get many prices for strikes
near the spot price. But the constraint implies that a big gives a coarse grid for integration. So we
face a trade-off between accuracy and the number of interesting strikes.
In order to obtain an accurate integration with larger values of , we incorporate Simpsons rule weightings into our summation in equation (3.26). With Simpsons rule weightings and the restriction = 2
N
, in line with Carr and Madan [CM99], the call price is given as the following
CT (ku ) =
N 1
exp(ku ) X iju i( 1 N s0 )vj
T (vj )
3 + (1)j j1 ,
e
e 2
(3.29)
j=0
where n is the Kronecker delta function that is unity for n = 0 and zero otherwise. The summation in
equation (3.29) is an exact application of the FFT. Now that we have a discretized fourier transform to
perfom, there are countless FFT algorithms available to us. Python or Scipy for example, has a built in
the module scipy.fftpack using the command scipy.fftpack.fft() or scipy.fftpack.ifft() to speed the FFT
algoritm.
One needs to make the appropriate choices for and . The next chapter addresses these issues of the
choice of our parameter and thier application.
3.3.4
Peter Tankov [Tan] devoloped a new ideas based on the Carr and Maddan [MCC98] approach for pricing
European call options in models where the characteristic function of the log stock price is known using
Fourier transform and, in particular, the Fast Fourier transform algorithm [CT65]. In fact, this method
propose several improvements to the original procedure and give a rigorous analysis of truncation and
discretization errors.
Let {Xt }t0 be a stochastic process on (W, F, P ) such that eXt is a martingale. In order to compute
the price of a call option
CT (k) = e
rT
rT +XT
+
(3.30)
we need to express its Fourier transform in log strike in terms of the characteristic function T (v) of XT
and then find the prices for a range of strikes by Fourier inversion. However, we cannot do this directly
because CT (k) is not integrable (it tends to a positive constant as k ). The key idea is to
instead compute the Fourier transform of the (modified) time value of the option, that is, the function
zT (k) = e
rT
rT +XT
+
+
1 ekrT
.
(3.31)
Proposition 3.3.1. Let {Xt }t0 be a stochastic process on (W, F, P ) such that eXt is a martingale
and
h
i
E e(1+)XT
<
t,
(3.32)
for some > 0. Then the Fourier transform of the time value of a call option is given by:
Z +
T (v i) 1
T (v) :=
eivk zT (k)dk = eivrT
.
iv(1 + iv)
(3.33)
Page 25
It is important to remark that as Rz , T (z) 0 and T (v) will behave like |v|2 at infinity
which means that the truncation error in the numerical evaluation of the inverse Fourier transform will
be large. The reason of such a slow convergence is that the time value (3.31) is not smooth; therefore
its Fourier transform does not decay sufficiently fast at infinity. For most models the convergence can
be improved by replacing the time value with a smooth function of strike.
Namely, instead of subtracting the intrinsic value of the option (which is non-differentiable) from its
price, we suggest to subtract the Black-Scholes call price with a non-zero volatility (which is a smooth
function). The resulting function will be both integrable and smooth. Suppose that the hypothesis of
the above proposition is satisfied and denote
+
T (v) = eivrT
T (v i)
T (v i)
,
iv(1 + iv)
(3.35)
T
2
where
T (v) = exp( 2 (v + iv)). Since for most models found in the literature (except variance
gamma) the characteristic function decays faster than every power of its argument at infinity, this means
that the expression (3.35) will also decay faster than every power of v as Rv , and the integral in
the inverse Fourier transform will converge very fast for every > 0.
Proof of the proposition 3.3.1. Since the discounted price process is a martingale, we can write
Z +
rT
zT (k) = e
T (dx)(erT +x ek )(1kx+rT 1krT ),
(3.36)
rT
+
.
iv + 1
iv(iv + 1)
iv(iv + 1)
= erT
T (dx)
(3.38)
(3.39)
The first term in braces disappears due to the martingale condition and the other two, after computing
the integrals, yield (3.35).
3.3.5
Option prices can be computed by evaluating numerically the inverse Fourier transform of T (v) in
equation (3.35):
Z +
1
zT (k) =
eivk T (v)dv,
(3.40)
2
Page 26
To approximate option prices, we truncate and discretize the integral (3.40) as follows:
1
2
ivk
T (v)dv =
1
2
A/2
eivk T (v)dv + T
(3.41)
A/2
N 1
A X
wm eivm k T (vm ) + T + D ,
2N
(3.42)
m=0
we see that the sum in equation (3.42) becomes a discrete Fourier transform:
N 1
A ikn A/2 X
e
wm f (km )e2inm/N .
2N
(3.43)
m=0
Therefore, the FFT algorithm allows to compute zT (k) and therefore option prices for the log strikes
2
2n
kn = N
. The log strikes are thus equidistant with the step d satisfying d = N .
4. Application
4.1
In this section, we apply the FFT option pricing algorithm of Section 3.3 to the models described in
Section 2.2. Besides the speed and accuracy of the FFT algorithm, our aim is to demonstrate the
possibility to numerically evaluate the formula of the option price while finding a closed-form solution
for the option prices which may require swathes of complicated algebra.
In order to apply the FFT-based algorithm, we need to know the characteristic function of the risk
neutral density which has been described in Section 3.2 for the Black-Scholes model. Moreover, we
have to decide on the parameters , N , and of the algorithm. The computation time depends
on the parameter N which we set to 512 implying a log strike spacing = 0.015. As the number of
grid points of the numerical integration is also given by N , this parameter in addition determines the
accuracy of the prices. For parameter , which determines the distance of the points of the integration
grid, we use 0.75. A limited simulation study showed that the FFT algorithm is not sensitive to the
choice of , i.e. small changes in gave similar results. For the choice of the dampening coefficient in
the call price, we used a value of = 1.1.
For a more detailed analysis, we evaluate the option prices in this case for strikes ranging from 80 to 120
in steps of a dollar, with the spot set at S0 = 100, the interest rate at r = 0.05, the variance = 0.5
and the maturity time is set to T = 1.
The FFT price approach, however, slightly overestimates the true prices since the call option price is a
convex function of the strike, we can see the plotting in figure 4.1. The FFT-based algorithm is fairly
efficient as shown in figure 4.2. Moreover, it returns prices for a whole range of strikes at one maturity.
27
Page 28
Figure 4.2: The Analytic solution vs the FFT price call option in the Black-Schole
4.2
The calculation of option prices by the FFT-based algorithm leads to different errors. The truncation
error results from substituting the infinite upper integration limit by a finite number. The sampling
error comes from evaluating the integrand only at grid points. Lee [Rog04] gives bounds for these
errors and discusses error minimization strategies. Besides the truncation and the sampling error, the
implementation of the algorithm often leads to severe roundoff errors because of the complex form of the
characteristic function for some models. To avoid this problem, which often occurs for long maturities,
it is necessary to transform the characteristic function.
For a more detailed evaluation of the pricing errors, we computed for the imaginary part of our numerical
result. In reality, our call option is not complex, so the real part is assume to be the numerical solution
and the imaginary part is the error. In fact, we use the Mean Error (ME) define as :
ME =
X
1
(FFT price Analytic price)
Number of options
options
As we can see in the plot of figure 4.3, the error behaviour shows that the FFT price is more accurate.
FFT is substantially more accurate and about twice as fast. Futhermore, the largest error of FFT pricing
occurs in the region of K = 2.5 ( which is typically not of interest), and then the error term becomes
essentially a constant less than 1 percent in the region of our interest.
The accuraty of the call price and the error depend both of the choice of . So, one need to make
an optimal choice for each model so that we can obtain more accurate price. The remain parameters
does not affect in reality the call price, but for the value of choose between [0.1, 0.6] and r between
[0.02, 0.06] we obtain accurate price.
4.3
For the VG model the analytic solution is not considered, we get a feel for the magnitude of error
introduced by fourier pricing from the Black-Scholes for which the fair price is known analytically. In
Page 29
Figure 4.3: The Error behaviour of the FFT price call option in the Black-Schole
order to apply the FFT-based algorithm we need to know the characteristic function of the risk neutral
density which has been described in Section 2.3 for the VG model. Moreover, the values of the following
parmeters, N , , , r, , , T remain the same as in the Black-Scholes. But, we choose to set the
values of = 0.1 and = 0.1. As we can see from the plot of figure 4.4, with the parameter as in
the Black-Sholes, the VG call option generate higher price with the same range of strike.
30
This program compute the analytic, the FFT and the error call option price
based on the Black-Schole model.
import numpy
from scipy import *
import scipy.fftpack
import math
import Gnuplot
#compute the constants
#########################################################
r=0.05
#risk free rate
sigma=0.5
#variance of the asset price
T=1
#maturity
N=512
#number of point
S0=100
s0=numpy.log(S0)
#initial asset price
varsigma=0.015
#the distance between the log strikes
eta=0.75
#the distance of the points of the integration grid
alpha=1.1
#daumping coefficient
#compute the expectation and variance of log asset price
###########################################################
MU_1=(r-0.5*(sigma**2))*T
# expectation
SIGMA_1=sigma*numpy.sqrt(T)
# variance
#compute vj corresponds to various log prices with eta spacing and log strike price kj
#-------------------------------------------------------gp=Gnuplot.Gnuplot(debug=-1)
gp(set data style line)
gp2=Gnuplot.Gnuplot(debug=-1)
gp2(set data style line)
v = numpy.linspace(0, N-1, N)
vj=[]
kj=[]
vjcompl=[]
caractfunct=[]
fourierCallPrice=[]
fourierCallPriceA=[]
d1=[]
d2=[]
for j in range(0,len(v),1):
vj.append(eta*v[j])
kj.append(-0.5*N*varsigma+varsigma*v[j]+s0)
d1.append((numpy.log((numpy.exp(s0+r*T))/numpy.exp(kj[j]))-0.5*(sigma**2)*T)/(sigma*numpy.sqrt(T)))
d2.append((numpy.log((numpy.exp(s0+r*T))/numpy.exp(kj[j]))+0.5*(sigma**2)*T)/(sigma*numpy.sqrt(T)))
vjcompl.append(complex(vj[j],-(alpha+1)))
#compute the caracteristic function
caractfunct.append(numpy.exp(complex(-0.5*(vjcompl[j]**2)*(SIGMA_1**2),vjcompl[j]*MU_1)))
#fourier transform of the call price
fourierCallPrice.append((numpy.exp(-r*T)*caractfunct[j])/(complex((alpha**2+alpha-(vj[j])**2),(2*alpha+1)*vj[j])))
fourierCallPriceA.append((eta/3)*(3+(-1**j)-1)*fourierCallPrice[j]*complex(numpy.cos((0.5*N*varsigma-s0)*vj[j]),numpy.sin((0.5*N*varsigma-s0)*vj[j])))
# compute the Normal distribution
Normd1=stats.norm.cdf(d1)
Normd2=stats.norm.cdf(d2)
# modified call price option
ModCallOptionPrice=(scipy.fftpack.fft(fourierCallPriceA))
#print ModCallOptionPrice
#print len(ModCallOptionPrice)
#print len(kj)
ErrorOption=[]
CallOption=[]
CallPriceOption=[]
RealCallPriceOption=[]
ImCallPriceOption=[]
AnalytCallOption=[]
AnalyticSolution=[]
for j in range(0,len(kj),1):
#call option price
CallPriceOption.append(((kj[j]**(-alpha))/numpy.pi)*ModCallOptionPrice[j])
AnalytCallOption.append(s0*Normd2[j]-kj[j]*(numpy.exp(-r*T))*Normd1[j])
RealCallPriceOption.append(CallPriceOption[j].real)
ImCallPriceOption.append(CallPriceOption[j].imag)
CallOption.append([kj[j]*numpy.exp(4),RealCallPriceOption[j]*numpy.exp(7.1)])
ErrorOption.append([kj[j]*numpy.exp(0),ImCallPriceOption[j]*numpy.exp(0)])
AnalyticSolution.append([kj[j]*numpy.exp(4),AnalytCallOption[j]*numpy.exp(1.7)])
print CallOption
print ErrorOption
print AnalyticSolution
plotCallOption = Gnuplot.PlotItems.Data(CallOption, with="line", title="Nunerical Call Option ")
plotErrorOption = Gnuplot.PlotItems.Data(ErrorOption, with="line", title="Call Option Error")
plotAnalyticSolution = Gnuplot.PlotItems.Data(AnalyticSolution, with="points", title="Analytic Call Option ")
#print CallPriceOption
gp2(set xr [0.5:4.5])
gp2(set yr [-0.12:0.005])
#gp(set xtic auto)
#gp(set ytic auto)
gp(set size ratio -1)
31
Page 32
gp(set xrange [80:120])
gp(set yrange [10:25])
gp(set xlabel " strike")
gp(set ylabel "call option price")
gp.plot(plotCallOption,plotAnalyticSolution)
gp2.plot(plotErrorOption)
gp.hardcopy(filename =Nicol + str(N)+ .eps,eps=True, fontsize=20, color=True)
import numpy
from scipy import *
import scipy.fftpack
import math
import Gnuplot
#compute the constants
#########################################################
r=0.05
#risk free rate
sigma=0.5
#variance of the asset price
T=1
#maturity
N=512
#number of point
S0=100
#log strike of the asset
s0=numpy.log(S0)
#initial asset price
varsigma=0.015
#the distance between the log strikes
eta=0.75
#the distance of the points of the integration grid
alpha=1.1
#daumping coefficient
#compute the VG parameters
###########################################################
nu=0.1
theta=-0.1
omega=(1/nu)*numpy.log(1-theta*nu-0.5*(sigma**2)*nu) # expectation
#compute vj corresponds to various log prices with eta spacing and log strike price kj
#-------------------------------------------------------gp=Gnuplot.Gnuplot(debug=-1)
gp(set data style line)
gp2=Gnuplot.Gnuplot(debug=-1)
gp2(set data style line)
v = numpy.linspace(0, N-1, N)
vj=[]
kj=[]
vjcompl=[]
caractfunct=[]
fourierCallPrice=[]
fourierCallPriceA=[]
for j in range(0,len(v),1):
#v1[j]=eta*v[j]
vj.append(eta*v[j])
kj.append(-0.5*N*varsigma+varsigma*v[j]+s0)
vjcompl.append(complex(1+0.5*(sigma**2)*(vj[j]**2)*nu,-(vj[j]*nu*theta)))
#compute the caracteristic function of VG model
caractfunct.append((vjcompl[j]**(-T/nu))*complex(numpy.cos((s0+(r+omega)*T)*vj[j]),numpy.sin((s0+(r+omega)*T)*vj[j])))
#fourier transform of the call price
fourierCallPrice.append((numpy.exp(-r*T)*caractfunct[j])/(complex((alpha**2+alpha-(vj[j])**2),(2*alpha+1)*vj[j])))
fourierCallPriceA.append((eta/3)*(3+(-1**j)-1)*fourierCallPrice[j]*complex(numpy.cos((0.5*N*varsigma-s0)*vj[j]),numpy.sin((0.5*N*varsigma-s0)*vj[j])))
# modified call price option
ModCallOptionPrice=(scipy.fftpack.fft(fourierCallPriceA))
ErrorOption=[]
CallOption=[]
CallPriceOption=[]
RealCallPriceOption=[]
ImCallPriceOption=[]
for j in range(0,len(kj),1):
#call option price
CallPriceOption.append((((numpy.log(kj[j]))**(-alpha))/numpy.pi)*ModCallOptionPrice[j])
RealCallPriceOption.append(CallPriceOption[j].real)
ImCallPriceOption.append(CallPriceOption[j].imag)
CallOption.append([kj[j]*numpy.exp(4),RealCallPriceOption[j]*numpy.exp(5.5)])
ErrorOption.append([kj[j]*numpy.exp(0),ImCallPriceOption[j]*numpy.exp(0)])
#print CallOption
print ErrorOption
plotCallOption = Gnuplot.PlotItems.Data(CallOption, with="line", title="Nunerical Call Option ")
plotErrorOption = Gnuplot.PlotItems.Data(ErrorOption, with="line", title="Call Option Error")
#print CallPriceOption
gp2(set xr [10:30])
gp2(set yr [0:5])
#gp(set xtic auto)
#gp(set ytic auto)
gp(set size ratio -1)
gp(set xrange [75:130])
gp(set yrange [0:30])
gp(set xlabel " strike")
gp(set ylabel "call option price")
gp.plot(plotCallOption,)
Page 33
#gp2.plot(plotErrorOption)
gp.hardcopy(filename =VG1 + str(N)+ .eps,eps=True, fontsize=20, color=True)
This program compute the Brownian and the Geometric Brownian path
This program compute the VG stock price dynamics and the VG process path
Page 34
from scipy import *
import Gnuplot
g=Gnuplot.Gnuplot(debug=1)
T=1
N=250
dt=T/N
a=10
b=20
tt=arange(0,N,dt)
gm=zeros(250)
for j in range(1,N):
gm[j]=gm[j-1]+gammavariate(a*dt,1/b)
g(set yrange [-0.5,0.5])
plot=Gnuplot.PlotItems.Data(gm, with = lines lw 2, title=Gamma process path)
g.plot(plot)
g.hardcopy(filename=gamma1.eps,eps=True, color=True)
Acknowledgements
I dedicated this essay to the God of gods Jesus Christ for his grace and mercy.
I would like to express my gratitude to my supervisor Doctor Peter Ouwehand for his advisement and
support throughout all the essay period. Without his guidance, it will be impossible for me to overcome
all the difficulties.
My sincere gratitude also goes to Professor Fritz Hahne of the African Institute of Mathematical Sciences
(AIMS) for giving me an opportunity and creating a friendly environment for me to undergo a post
graduate studies, to Professor Neil Turok for founding AIMS. Doctor Maciej Capi
nski has offered a lot
of resource to me in the literature review, and this helped me in some difficult cases. I will not forget
my great family Tchamga for all his distance support. Also, I would like to say thank you to Veronica
my tutor and to all the AIMSs family. At this moment, I would like to say that, it is my pleasure to
know all of you, learn from you and get the help from you. I am grateful for all of you. For everything,
I give the glory to God.
35
References
[Ber07]
Jason Bertran, Pricing options: Harnessing the power of fft, 2007, Unpublished manuscript.
[BfIS09] Bank for International Settlements, Amounts outstanding of over-the-counter (otc) derivatives, 2009, http://www.bis.org/statistics/otcder/dt1920a.pdf.
[BM97]
[Cer04]
[CM99]
Peter Carr and D. B. Madan, Option valuation using the fast fourier transform, journal of
computational Finance 2 (1999), 6165, 6669.
[CT65]
J. W. Cooley and J. W. Tukey, An algorithm for the machine calculation of complex fourier
series, Math. Comp. 19 (1965), 297301.
Lee Roger, Option pricing by transform methods: extensions, unification and error control,
Journal of Computational Finance 7 (2004), 1037.
[Sch08]
[Sco97]
L. O. Scott, Pricing stock options in a jump-diffusion model with stochastic volatility and
interest rates, Mathematical Finance 7 (1997), 413426.
[Tan]
Peter Tankov, Fourier transform methods for european option pricing, Unpublished
manuscript.
[TT03]
[WHd95] Paul Wilmott, Sam Howison, and Jeff dewynne, The mathematics of financial derivative:a
student introduction, University of Cambridge, 1995.
36