Introduction To Fast Fourier Transform in
Introduction To Fast Fourier Transform in
FINANCE
A. CERNY
Tanaka Business School Discussion Papers: TBS/DP04/19
London: Tanaka Business School, 2004
ISSN 1744-6783
Introduction to Fast Fourier Transform in Finance
Ale
Cern (a.cerny@imperial.ac.uk)
Tanaka Business School, Imperial College London
First draft: July 2003, this version 18th June 2004
Typo in eq. (39) corrected 29th September 2004
Abstract. The Fourier transform is an important tool in Financial Economics. It
delivers real time pricing while allowing for a realistic structure of asset returns,
taking into account excess kurtosis and stochastic volatility. Fourier transform is
also rather abstract and therefore o-putting to many practitioners. The purpose
of this paper is to explain the working of the fast Fourier transform in the familiar
binomial option pricing model. We argue that a good understanding of FFT requires
no more than some high school mathematics and familiarity with roulette, bicycle
wheel, or a similar circular object divided into equally sized segments. The returns
to such a small intellectual investment are overwhelming.
Keywords: fast Fourier transform, option pricing, binomial lattice, chirp-z trans-
form, GAUSS, MATLAB
JEL classication code: C63, G12
Mathematics subject classication: 65T50, 91B70, 91B24
W
Forthcoming in Journal of Derivatives. I would like to thank David Miles and
Jonathan Wainwright for suggesting important clarications in an early draft. I am
grateful to Peter Carr, Sanjiv Das and Stephen Figlewski, who provided helpful
comments and pointers to references. This is an abridged and adapted version of of
Cern y [2004, Chapter 7]. GAUSS is a trademark of Aptech Systems, Inc.; MATLAB
is a registered trademark of The MathWorks, Inc.
2 A.
Cern y
The Fourier transform is becoming an increasingly popular and im-
portant tool in Financial Economics because it delivers real time pricing
while allowing for important properties of asset returns, such as excess
kurtosis, stochastic volatility and leverage eects, discussed in Heston
[1993], Carr and Madan [1999], Carr and Wu [2004]. These impressive
results come at a price in the form of a considerable abstraction which
can be quite o-putting to practitioners. The aim of this paper is to
explain the working of the discrete Fourier transform (DFT) and its fast
implementation (FFT) in the familiar binomial option pricing model.
The binomial model serves two purposes. It highlights, in an accessible
way, the usefulness of FFT, which is an important computational tool
in its own right, and has many other applications in Finance. It also
motivates the passage to continuous time thereby providing intuition
behind fast pricing formulae in a very rich class of models used in the
industry.
The paper is divided into three parts: I Discrete Fourier transform
and binomial option pricing; II E!cient implementation of DFT
by means of fast Fourier transform, with examples in GAUSS and
MATLAB; III Fourier transform and continuous-time option pricing.
1. Discrete Fourier transform and binomial option pricing
This section explains how and why option prices in the binomial model
can be computed via discrete Fourier transform. We assume that the
reader is familiar with the concept of risk-neutral pricing. To begin
with, we introduce complex numbers and discuss their geometric prop-
erties, especially as they regard the unit circle; then we dene the
Discrete Fourier Transform (DFT) and highlight some of its proper-
ties. The following section introduces a simple binomial option pricing
example and shows how the pricing procedure can be performed on a
circle. To conclude, we demonstrate how to transform circular convo-
lutions using DFT and obtain the Fourier transform pricing formula.
The resulting formula is put to practice in part II, which shows how
to accelerate DFT by means of FFT algorithm and provides simple
GAUSS and MATLAB codes for illustration. Real-world applications
of the Fourier transform pricing formula are discussed in part III.
1.1. Introduction to complex numbers
The discrete Fourier transform is about evenly spaced points on a circle.
From the mathematical point of view, evenly distributed points on
a circle are most easily described by complex numbers. This section
Introduction to FFT in Finance 3
2 i
2 + i
2
1 i
1
0
Figure 1.
reviews the geometry of those numbers, which in turn determine the
properties of Fourier transform.
Complex numbers are a convenient way of capturing vectors in a
two-dimensional space. For example, Exhibit 1 depicts a vector
2 + i;
it is a point in the plane if we move two units on the real (horizontal)
axis and one unit on the imaginary (vertical) axis. This terminology
is somewhat unfortunate; the imaginary axis is no less real than the
real axis. It would be more appropriate to talk about horizontal and
vertical numbers.
The rules for addition of complex numbers are the same as with
vectors, for example
2
1
+
3
4
=
5
3
2
1
=
6
3
.
The angle corresponding to i is 90
or
Z
2
, the angle corresponding to
1 is 180
+90
= 180
which
corresponds to 1, see Exhibit 4a. In complex number notation this
gives the famous formula
i i = i
2
= 1. (1)
With (1) in hand the general denition of complex multiplication follows
naturally
(a
1
+ ib
1
) (a
2
+ ib
2
) = a
1
a
2
+ i (b
1
a
2
+ a
1
b
2
) + b
1
b
2
i
2
=
= a
1
a
2
b
1
b
2
+ i (b
1
a
2
+ a
1
b
2
) . (2)
It also follows that the multiplication is adding angles rule works quite
generally on the unit circle
(cos ,
1
+ i sin,
1
) (cos ,
2
+ i sin,
2
) =
= cos (,
1
+,
2
) + i sin(,
1
+,
2
) . (3)
One can express points on the unit circle more elegantly using the Euler
formula
cos , + i sin, = e
i)
, (4)
whereby (3) becomes
e
i)
1
e
i)
2
= e
i()
1
+)
2
)
, (5)
see Exhibit 4b.
1.3. Geometry of spoked wheels
It is very easy to construct a wheel with evenly placed spokes using
complex numbers. Suppose we want to place ve evenly spaced points
on the unit circle. One fth of the full circle is characterized by the
angle
2Z
5
, hence the rst spoke will be placed at e
i
2Z
5
. Let us denote this
number by z
5
(fth root of unity)
z
5
e
i
2Z
5
.
Since the multiplication by z
5
causes anticlockwise rotation by one fth
of full circle the second spoke will be (z
5
)
2
the third spoke at (z
5
)
3
and
so on, see Exhibit 5a.
6 A.
Cern y
1
i
i*i = -1
S
0
S/2
exp(i(M
1
+M
2
))
exp(iM
2
)
exp(iM
1
)
1
i
M
2
M
1
M
1
+M
2
a)
b)
Figure 4.
4
(z
5
)
4
(z
5
)
3
(z
5
)
2
z
5
i
1 = (z
5
)
0
= (z
5
)
5
2S/5
-1
-4
1
2
-3
-5 0 5
-2
3
a)
b)
Figure 5.
This provides a natural numbering of the spokes, according to how
many elementary rotations are needed to reach the particular spoke.
Note that since we are moving in a circle we will come back to the
starting point after ve rotations anticlockwise
(z
5
)
0
= (z
5
)
5
= (z
5
)
10
= (z
5
)
15
= . . .
(z
5
)
1
= (z
5
)
6
= (z
5
)
11
= (z
5
)
16
= . . . etc.,
Introduction to FFT in Finance 7
and also after ve rotations clockwise
(z
5
)
0
= (z
5
)
35
= (z
5
)
310
= (z
5
)
315
= . . .
(z
5
)
1
= (z
5
)
34
= (z
5
)
39
= (z
5
)
314
= . . . etc.
Thus the numbering of spokes is ambiguous; for example indices 0, 5, 5
refer to the same spoke, see Exhibit 5b.
The following box summarizes the most important properties of
evenly spaced points on the unit circle. These properties are essential
for the understanding of the discrete Fourier transform.
Let z
n
be a rotation by one nth of a full circle
z
n
e
i
2Z
n
.
Then
(z
n
)
0
+ (z
n
)
1
+ . . . + (z
n
)
n31
= 0 (6)
for any n. This is because the points (z
n
)
0
, (z
n
)
1
, . . . , (z
n
)
n31
are evenly
distributed on a unit circle and thus the result of summation must not
change if we rotate the set of points by one nth of a full circle. The only
vector that remains unchanged after such rotation is zero vector.
One can generalize this result further. Let k be an integer between 1
and n 1. Then
z
k
n
0
+
z
k
n
1
+ . . . +
z
k
n
n31
= 0 (7)
for any n. The reason for this result is again rotational symmetry of
points
z
k
n
0
,
z
k
n
1
, . . . ,
z
k
n
n31
. The dierence from (6) is that in
the sequence (z
n
)
0
, (z
n
)
1
, . . . , (z
n
)
n31
each spoke occurs exactly once,
whereas in
z
k
n
0
,
z
k
n
1
, . . . ,
z
k
n
n31
the same spoke can occur several
times (try n = 4, k = 2).
The case with k = 0 requires special attention. Since
z
0
n
j
= 1 for all j
we have
z
k
n
0
+
z
k
n
1
+ . . . +
z
k
n
n31
= n.
To summarize,
z
k
n
0
+
z
k
n
1
+ . . . +
z
k
n
n31
= n for k = 0, n, 2n, . . .(8)
z
k
n
0
+
z
k
n
1
+ . . . +
z
k
n
n31
= 0 for k 6= 0, n, 2n, . . .(9)
8 A.
Cern y
1.4. Reverse order on a circle
Given a sequence of n numbers a = [a
0
, a
1
, . . . , a
n31
] we can say that
rev(a) [a
0
, a
n31
, . . . , a
1
]
is a in reverse order. If a is written around a circle in anticlockwise
direction then rev(a) is found by reading from a
0
in clockwise direction,
see Exhibit 6. Note that rev(a) is not equal to [a
n31
, . . . , a
1
, a
0
].
a
n-1
a
rev(a )
a
n-2
a
1
a
2
a
0
Figure 6.
For any k the sequence
z
k
n
0
,
z
k
n
1
, . . . ,
z
k
n
n31
is the same as the sequence
z
3k
n
0
,
z
3k
n
1
, . . . ,
z
3k
n
n31
taken in the reverse order:
rev
z
3k
n
0
,
z
3k
n
1
, . . . ,
z
3k
n
n31
=
z
k
n
0
,
z
k
n
1
, . . . ,
z
k
n
n31
. (10)
This is because
z
3k
n
n3j
= z
3kn+kj
n
= z
kj
n
=
z
k
n
j
for any j.
1.5. Discrete Fourier Transform (DFT)
As in the previous section take z
n
e
i
2Z
n
(this number is called the
nth root of unity ). Let a
0
, a
1
, . . . , a
n31
be a sequence of n (in general
complex) numbers. The discrete Fourier transform of a
0
, a
1
, . . . , a
n31
is the sequence b
0
, b
1
, . . . , b
n31
such that
b
k
=
a
0
z
k
n
0
+ a
1
z
k
n
1
+ . . . + a
n31
z
k
n
n31
s
n
= (11)
=
1
s
n
n31
X
j=0
a
j
z
jk
n
=
1
s
n
n31
X
j=0
a
j
e
i
2Z
n
jk
Introduction to FFT in Finance 9
We write
F (a) = b.
Equation (11) represents the forward transform. The inverse transform
is
a
l
=
b
0
z
3l
n
0
+
b
1
z
3l
n
1
+ . . . +
b
n31
z
3l
n
n31
s
n
= (12)
=
1
s
n
n31
X
k=0
b
k
z
3kl
n
=
1
s
n
n31
X
k=0
b
k
e
3i
2Z
n
kl
,
and we write
a = F
31
.
Facts:
The inverse discrete Fourier transform of sequence
b
0
,
b
1
, . . . ,
b
n31
is the
same as the forward transform of the same sequence in reversed order
F
31
= F
rev
, (13)
and vice versa
F
31
rev
= F
. (14)
This is a direct consequence of (10).
F
31
is indeed an inverse transformation to F, that is
F
31
(F (a)) = F
F
31
(a)
= a. (15)
This result relies on (8) and (9); for a proof see Appendix.
1.6. Binomial option pricing
Consider a monthly distribution of FTSE 100 return calibrated to re-
ect market volatility of 4.4% a month and expected rate of return
0.9% a month:
pR
u
+ (1 p)R
d
= 1.009
pR
2
u
+ (1 p)R
2
d
= 0.044
2
+ 1.009
2
.
Choosing the objective probability to be p =
1
2
we solve for R
u
and R
d
R
u
= 1. 053 with p
u
=
1
2
(16)
R
d
= 0. 965 with p
d
=
1
2
. (17)
10 A.
Cern y
Assuming that the initial value of FTSE Index is 5100.00 points, the
evolution of the index in the three months ahead is given by the lattice
in Exhibit VII.
Table VII. Binomial stock price lattice.
number of
low returns
S(0) S(1) S(2) S(3)
0 5100.00 5370.30 5654.93 5954.64
1 4921.50 5182.34 5457.00
2 4749.25 5000.96
3 4583.02
Suppose we wish to price a call option struck at K = 5355 (5% out
of the money), maturing 3 months from now. The intrinsic value of the
option at maturity is
C(3) = [] . (18)
Asset pricing theory tells us that the no-arbitrage price of the pay-o
C
u
C
d
0.5629
0
0.4338
c)
0.5629
0
0.4338 599.64
102.0
0
d)
0.5629
0
0.4338
599.64
102.0
0
b)
0.5629
0
0.4338
599.64
102.0
0
Figure 11.
Table XII. Option prices obtained from circular pricing
formula (25). The useful entries are in bold.
number of
low returns
C(0) C(1) C(2) C(3)
0 81.36 162.66 317.54 599.64
1 115.28 19.19 44.25 102.00
2 265.47 190.01 0.00 0.00
3 232.62 325.17 337.54 0.00
1.8. Circular pricing via discrete Fourier transform
In this section we will reformulate the circular pricing formula (25)
using the discrete Fourier transform. Although we derive the Fourier
pricing formula mechanically, in part III we will spell out its more
intuitive probabilistic intepretation.
Introduction to FFT in Finance 15
The discrete Fourier transform has one very useful property it
turns circular convolutions into products:
F (a ~b) =
s
nF (a) F (b) , (26)
F
31
(a ~b) =
s
nF
31
(a) F
31
(b) , (27)
n = dimension of a; (28)
see Appendix for a proof. This can be used to a great advantage in
pricing. Recall from the preceding section that
C
0
= C
N
~
N times
z }| {
rev(q) ~rev(q) ~. . . ~rev(q) /R
N
f
,
where N is the number of time periods to maturity. Now apply the
inverse transform F
31
to both sides, using property (27) on the right
hand side
F
31
(C
0
) = F
31
(C
N
)
p
dimension of C
N
F
31
(rev(q)) /R
f
N
.
(29)
In a binomial model the dimension of C
N
is N +1. Furthermore, recall
from (14) that F
31
(rev(q)) = F (q) and substitute this into (29)
F
31
(C
0
) = F
31
(C
N
)
s
N + 1F (q) /R
f
N
.
Finally, apply the forward transform to both sides again and use (15)
on the left hand side:
C
0
= F
F
31
(C
N
)
s
N + 1F (q) /R
f
.
Option pricing via discrete Fourier transform.
Consider a model with IID stock returns and constant interest rate, repre-
sented by a recombining binomial tree with N periods and N + 1 trading
dates. Let the (N +1)-dimensional vector C
N
be the pay-o of the option at
expiry. Let q contain the one-step risk-neutral probabilities as the rst two
entries, with the remaining N 1 entries being zeros. Then the rst element
of (N + 1)-dimensional vector C
0
,
C
0
= F
F
31
(C
N
)
s
N + 1F (q) /R
f
, (30)
is the no-arbitrage price of the option at time 0. The role of the forward and
inverse transforms is symmetrical, that is we also have
C
0
= F
31
F (C
N
)
s
N + 1F
31
(q) /R
f
. (31)
16 A.
Cern y
2. Fast Fourier Transform (FFT)
This section deals with the implementation of the pricing formula (30)
on a computer using fast DFT routines, known as FFTs. It is highly
unlikely that the reader will want to write his or her own DFT code,
for this would be counterproductive given the wealth and the level of
specialization of ready-made algorithms. The use of prepackaged algo-
rithms saves time, but with little documentation at hand implementing
otherwise sound mathematical formula may not prove straightforward.
This section provides guidelines that ensure a trouble-free transition
between the theoretical pricing formula (30) and a computer code
using a DFT routine of readers choice, with specic examples given
in GAUSS and MATLAB.
Two main issues arise in the use of (fast) DFT routines: 1) nd-
ing out the mathematical denition of a specic DFT routine, and 2)
choosing the right input length to make the computation fast. We now
address these two issues in turn.
1. Every textbook, and indeed every computer language, denes the
forward and inverse transforms slightly dierently. Thus the rst
task of any user is to nd out how a given computer routine, call
it dft, is related to the theoretical transforms F and F
31
dened
in (11) and (12). To do so, one proceeds in two simple steps:
a) In the rst step one determines the normalization factor. Dene
a = [1 0 0 0] and compute a = dft (a). If a
0
= 0.25 then
either dft = F/
s
n or dft = F
31
/
s
n;
else if a
0
= 0.5 then
either dft = F or dft = F
31
;
and if a
0
= 1 then
either dft =
s
nF or dft =
s
nF
31
.
b) To ascertain whether one is dealing with a forward or an inverse
transform, one denes b = [0 1 0 0] and evaluates
b = dft (b).
If the imaginary part of
b
1
is positive then dft is proportional
to F, otherwise it is proportional to F
31
. In the case of the
lattice pricing formulae (30) and (31) one will use two routines,
say dft and dfti, which are inverse to each other. In this
instance it does not really matter which of the two transforms
is forward and which is inverse. But there are other applications
(see Section 3), where it is absolutely crucial to know whether
a given routine is proportional to F or F
31
.
Introduction to FFT in Finance 17
EXAMPLE 1. In GAUSS the two DFT transforms are called
dfft and dffti, respectively, and they are related to F and
F
31
as follows:
dfft(a)
F
31
(a)
s
n
,
dffti(a)
s
nF (a) ,
where n is the dimension of vector a. Equation (30) therefore
becomes
C
0
= dffti
dfft (C
N
) (dffti(b))
N
. (32)
Suppose the vectors C_ N and b have already been dened in
GAUSS. To compute the option price at t = 0 we would use the
following code:
C_0 = dffti( dfft(C_N).*(dfft(b)^N) ); (33)
print no-arbitrage price at t=0 is C_0[1];
The . command stands for element-by-element multiplica-
tion.
The DFT algorithm is approximately three times faster than
the backward recursion in binomial model; the computational
time for both algorithms grows quadratically with the number
of periods
1
, see Exhibit XIII.
Table XIII. Comparison of pricing speed in a binomial lattice between
backward recursion and discrete Fourier transform formula (30).
trading interval number of execution time in seconds
in minutes periods DFT backward recursion
60 504 0.15 0.4
30 1008 0.6 1.6
15 2016 2.3 6.4
5 6048 20.8 61.6
Pentium III 750MHz, 128Mb RAM, GAUSS
2. A naive implementation of DFT algorithm with n-dimensional in-
put requires n
2
complex multiplications (see example above). An
1
GAUSS programes Binomial.gss and DFT.gss available from my website.
18 A.
Cern y
e!cient implementation of DFT, known as the fast Fourier trans-
form (FFT), will only require Knlnn operations
2
, but one still has
to choose n carefully because the constant K can be very large
for some choices of n. Some FFT implementations automatically
restrict the transform length to the most suitable values of n (typ-
ically n = 2
p
or n = 2
p
3
q
5
r
), which is the case in GAUSS. Others,
such as MATLAB, will compute FFT of any length; here it is par-
ticularly important for the user to choose n sensibly, otherwise the
FFT algorithm may turn out to be very slow indeed.
EXAMPLE 2. The forward and inverse FFT in MATLAB are
called fft and ifft, respectively:
fft(a)
s
nF
31
(a) (34)
ifft(a)
F (a)
s
n
, (35)
where n is the dimension of vector a. The option pricing equation
(30) therefore becomes
C
0
= ifft
fft (C
N
) ((N + 1) ifft (b))
N
,
which in terms of MATLAB code reads
C_0 = ifft( fft(C_N).*(((N+1)*ifft(b)).^N) ); (36)
sprintf no-arbitrage price at t=0 is %0.2f C_0(1);
The commands .* and .^ stand for element-by-element multi-
plication and exponentiation, respectively.
There are many instances when FFT of length n
1
is faster than FFT
of length n
2
even though n
1
> n
2
. This somewhat counterintuitive
phenomenon is illustrated in Exhibit XIV.
To understand why some transform lengths are more suitable than
others we need one piece of terminology and one fact: i) FFT algo-
rithm for length n = 2
p
is called radix-2 algorithm; ii) the higher
2
The fast Fourier transform does not appear in undergraduate textbooks on
numerical mathematics and the most useful references on the introductory level
are web based, see http://www.fftw.org/links.html, and in particular the online
manual Hey [1999]. An e!cient implementation of FFT for all transform lengths is
suggested in Frigo and Johnson [1998]; it is used in Matlab. E!cient implementation
of mixed 2, 3, 5-radix algorithm is due to Temperton [1992]; it is used in GAUSS.
Duhamel and Vetterli [1990] is an excellent survey of FFT algorithms.
Introduction to FFT in Finance 19
Table XIV. Execution time of FFT algorithm for dierent input
lengths n.
n factorization execution time in seconds
499 979 499 979 27.2
1048 575 3 5
2
11 31 41 5.2
1048 576 2
20
0.93
1080 000 2
6
3
3
5
4
0.11
Pentium III 750MHz, 128Mb RAM, MATLAB
the b the slower the radix-b algorithm per output length. There is
one notable exception: radix-4 is faster than radix-2 by about 25%.
In practice, one uses transforms of size n = 2
p
3
q
5
r
. If the original
vector size is not of this form, then a su!cient number of zeros is
added. Ideally, q and r should be small compared to p because of
the fact ii) above. The advantage of using mixed-radix algorithms
is twofold: a) more transform lengths are available, which means
one need not pad the input with too many zeros; b) one can use
the operation-saving prime factor algorithm
3
.
To illustrate the item a), with vector size 2
10
+ 1 = 1025 the next
available size for radix-2 algorithm is n = 2048 = 2
11
but with
mixed 2,3,5-radix algorithm one could use length n = 1080 = 2
3
3
3
5
which is nearly twice as small and consequently the Fourier trans-
form evaluation is twice as fast compared to radix-2 algorithm.
To illustrate property b), one should notice that highly compos-
ite lengths such as 1080000 = 2
6
3
3
5
4
evaluate faster than simple
powers of similar length such as 2
20
= 1048 576, see Exhibit XIV.
Transforms which are not of the length n = 2
p
3
q
5
r
can take very
long to compute, especially if n is a large prime, again see Exhibit
XIV.
EXAMPLE 3. MATLAB will allow the user to perform FFT of
any length; this is done using commands (34) and (35). However,
as we have noted above, it is eminently sensible to restrict transform
lengths to n = 2
p
3
q
5
r
with q and r small relative to p to obtain the
best performance. MATLAB provides function nextpow2 giving the
next bigger power of 2. In addition, MATLAB allows the user to
3
The prime factor algorithm (PFA) works faster because the factors 2, 3 and 5
have no common divisors, see Temperton [1992].
20 A.
Cern y
specify the transform length by including it as a second optional
argument of fft and ifft. Hence a fast implementation of (36)
in MATLAB would read:
length = 2^nextpow2(N+1);
C_0 = ifft( fft(C_N,length).*((length*ifft(b,length)).^N) );
The padding of the original input C_N by zeros to the dimension
length is done automatically.
To nd the nearest transform length of the form n = 2
p
3
q
5
r
one
can use the following code:
length = N+1;
while max(factor(length)) > 5;
length = length+1;
end;
EXAMPLE 4. In GAUSS the fast Fourier forward and inverse
transforms are performed by functions fftn and ffti. These func-
tions use Tempertons [1992] mixed 2,3,5-radix algorithm, and the
padding of input vector by zeros to the nearest available length
n = 2
p
3
q
5
r
is done automatically. If n is the input dimension the
output dimension from fftn and ffti will be nextn(n). In terms
of GAUSS code one writes similarly as in (33):
C_0 = ffti( fftn(C_N).*(ffti(b)^N) );
One can increase the speed further by choosing a composite length
n = 2
p
3
q
5
r
where q and r are non-zero but small relative to p. The
optimal length is given by GAUSS function optn (N + 1) , and the
padding by zeros to this dimension must be performed by the user.
The FFT implementation of binomial pricing algorithm
4
has a blis-
tering speed compared to the DFT, see Exhibit XV.
Because it is so fast one can explore higher trading frequencies and
see that the BlackScholes formula really does describe the limiting
value, see Exhibit XVI. Note that the BlackScholes formula itself is
still about 10 000 times faster than the FFT algorithm.
4
GAUSS code FFT.gss available from my website.
Introduction to FFT in Finance 21
Table XV. Speed of binomial pricing using DFT and FFT
algorithms.
trading interval number of execution time in seconds
in minutes periods DFT FFT
30 1008 0.6 0.003
15 2016 2.3 0.006
5 6048 20.8 0.022
1 30240 510 0.27
Pentium III 750MHz, 128Mb RAM, GAUSS
Table XVI. Option price and option delta in continuous-time limit and its
binomial approximation.
BlackScholes
4t (seconds) 60 10 1 0
Option price 75.93398 75.93284 75.93286 75.93288
Option delta 0.31668534 0.31668346 0.31668334 0.31668331
3. Further applications of FFT in nance
Practical applications of DFT (FFT) in modern nance go beyond the
binomial model, but the essential structure of the pricing formulae is
that of equation (30). To motivate the passage to continuous time, let
us rewrite the DFT pricing equation (30) to take explicit account of the
maturity date T and the rebalancing frequency 4t, with N
4t
= T/4t
trading periods and instantaneous risk-free rate r:
C
0
= F
F
31
(C
T,4t
)
q
N
4t
+ 1F (q
4t
) e
3r4t
N
4t
= e
3rT
F
F
31
(C
T,4t
)
q
N
4t
+ 1F (q
4t
)
N
4t
. (37)
The quantity
p
N
4t
+ 1F (q
4t
)
N
4t
is known as the (risk-neutral)
characteristic function of log stock price, and in practice one is mainly
interested in models where the continuous-time limit of (37) is avail-
able in closed form. This is the case in the class of exponential Lvy
models with a!ne stochastic volatility process, discussed in Carr and
Wu [2004]. This class contains a large number of popular models al-
22 A.
Cern y
lowing for excess kurtosis, stochastic volatility and leverage eects.
It includes, among others, the stochastic volatility models of Heston
[1993], Du!e et al. [2000] and all exponential Lvy models (see, for
example, Madan and Seneta [1990] and Eberlein et al. [1998]). For an
exhaustive characterization of a!ne processes see Du!e et al. [2003].
In the continuous-time limit the discrete Fourier transform is re-
placed by the (continuous) Fourier transform: that is we wish to nd
coe!cients c(v) such that
C
T
(lnS
T
) =
Z
q+i"
q3i"
c(v)e
iv lnS
T
dv (38)
for some real constant a
5
. The recipe for obtaining the coe!cients c(v)
is known it is given by the inverse Fourier transform
6
:
c(v) =
1
2
Z
3q+i"
3q3i"
C
T
(lnS
T
)e
3iv lnS
T
dv. (39)
For example, a simple calculation in Carr and Madan [1999] shows that
coe!cients c of a call option with strike price e
k
take the form
c(v) =
e
3(v31)k
2v(v 1)
for Re v > 1.
Substituting for C
T
from (38) the risk-neutral pricing formula reads
C
0
(lnS
0
) = e
3rT
E
Q
[C
T
(lnS
T
)]
= e
3rT
E
Q
"
Z
q+i"
q3i"
c(v)e
iv lnS
T
dv
#
= e
3rT
Z
q+i"
q3i"
c(v)E
Q
h
e
iv lnS
T
i
dv, (40)
where E
Q
[e
iv lnS
T
] is the risk-neutral characteristic function of log stock
price. It is now clear that the continuous-time pricing formula (40) is
a direct analogy of its discrete-time counterpart (37), whereby instead
of the discrete characteristic function
p
N
4t
+ 1F (q
4t
)
N
4t
we use
the continuous characteristic function E
Q
h
e
iv lnS
T
i
; instead of discrete
Fourier coe!cients F
31
(C
T,4t
) we use the continuous coe!cients c,
and instead of summation we use integration.
5
For the Fourier transform to work CT (lnST )S
3q
T
must be integrable as a func-
tion of lnS
T
. There are derivative securities, such as call and put options, where one
needs to take q 6= 0 to insure integrability (q > 1 for the call, q > 0 for the put).
6
Some unrestrictive technical conditions must hold to make sure that for given
in (39) equation (38) holds for all values of lnS
T
, see Chandrasekharan [1989].
Introduction to FFT in Finance 23
There is, nevertheless, one major dierence between (37) and (40):
whereas the former spends signicant amount of time computing the
characteristic function of log returns and Fourier coe!cients of the
option, the latter has both quantities available in closed form. This
makes the continuous-time pricing formula (40) even faster than the
accelerated binomial formula (30).
EXAMPLE 5. In the celebrated Heston [1993] model,
do
2
t
= (a bo
2
t
)dt + oo
t
dB
Q
1
dlnS
t
=
r
o
2
t
2
!
dt +o
t
dB
Q
2
,
we have
c
Q
(iv) = E
Q
h
e
v ln(S
T
/S
0
)
i
= e
(v)+B(v)j
2
0
,
(v) = rTv +
a
o
2
b j ov 2 ln
1 c
2
(v)e
c
1
(v)T
1 c
2
(v)
!!
,
c(v) =
(b j ov + c
1
(v))
1 e
c
1
(v)T
o
2
1 c
2
(v)e
c
1
(v)T
,
c
1
(v) =
q
(b j ov)
2
o
2
(v + v
2
),
c
2
(v) =
b j ov + c
1
(v)
b j ov c
1
(v)
,
where j = Corr(dB
Q
1
, dB
Q
2
).
Option pricing therefore boils down to evaluation of integrals of the
type
C
0
(lnS
0
) = S
0
e
3rT
Z
q+i"
q3i"
e
(v31)(lnS
0
3k)
2v(v 1)
c
Q
(iv)dv
= 2S
0
e
3rT
Z
q+i"
q+i0
Re
e
(v31)(lnS
0
3k)
2v(v 1)
c
Q
(iv)
!
dv, (41)
where both c(v) and c
Q
(v) are known. To evaluate (41) one truncates
the integral at a high value of Imv and then uses a numerical quadra-
ture to approximate it by a sum, see Lee [2004] for a detailed exposition.
This yields an expression of the type
C
0
(lnS
0
) 2 Re
3
C
S
0
e
3rT
n31
X
j=0
w
j
e
(v
j
31)(lnS
0
3k)
2v
j
(v
j
1)
c
Q
(iv
j
)
4
D
, (42)
24 A.
Cern y
where the integration weights w
j
and abscissas v
j
depend on the quadra-
ture rule. It is particularly convenient to use Newton-Cotes rules, which
employ equidistantly spaced abscissas. For example, a trapezoidal rule
yields
v
j
= a + ij4v, (43)
Imv
max
= (n 1)4v,
w
0
= w
n
=
1
2
4v,
w
1
= w
2
= ... = w
n31
= 4v.
In conclusion, if the characteristic function of log returns is known,
one needs to evaluate a single sum (42) to nd the option price. Con-
sequently, there is no need to use FFT if one wishes to evaluate the
option price for one xed log strike k.
3.1. FFT option pricing with multiple strikes
The situation is very dierent if we want to evaluate the option price
(42) for many dierent strikes simultaneously. Let us consider m = 121
values of moneyness i
l
= lnS
0
k
l
ranging from 30% to 30% with
increment 4i = 0.5%
i
l
= i
max
l4i, (44)
i
max
= 0.30, l = 0, . . . , m1. (45)
The idea of using FFT in this context is due to Carr and Madan [1999],
and it has recently been improved upon by using so-called z-transform,
see Chourdakis [2004]:
DEFINITION 6. The number
a
0
z
0
+ a
1
z
31
+ . . . + a
n31
z
3(n31)
is called the z-transform of sequence a. The discrete Fourier transform
of sequence a is obtained as a special case of z-transform with n specic
values of z:
z
l
= e
3i
2Z
n
l
, l = 0, 1, . . . , n 1.
Carr and Madan have noted that with equidistantly spaced abscissas
(43) one can write the option pricing equation (42) for dierent strike
values (44, 45) as a z-transform with z
l
= e
3i4v4Vl
:
C
0l
= 2S
0
e
(q31)V
l
3rT
Re
n31
X
k=0
e
i4v4Vkl
a
j
, (46)
a
j
= w
j
e
ij4vV
max
c
Q
(iv
j
)
2v
j
(v
j
1)
.
Introduction to FFT in Finance 25
Setting
4v4i =
2
n
(47)
Carr and Madan obtain a discrete Fourier transform in (46). Chour-
dakis [2004] points out that there is a fast algorithm for the z-transform
which works even when 4v4i 6=
2Z
n
and m 6= n:
Chirp-z transform
Chirp-z transform is an e!cient algorithm for evaluating the z-transform for
m dierent points z of the form
z
k
= Aw
k
, k = 0, 1, . . . , m1,
where A and w are arbitrary complex numbers. The chirp-z transform works
by rephrasing the original z-transform as a circular convolution and then
computing this convolution by means of three FFTs as shown in Part I,
Section Circular pricing via DFT. For more details see Bluestein [1968],
Rabiner et al. [1969], and Bailey and Swartztrauber [1991]. Compared to the
standard n-long FFT the chirp-z algorithm is approximately 6(lnm+1)/ lnn
times slower, for m n.
The MATLAB command for chirp-z transform of n-long input sequence a
reads
czt(a, m, w, A).
A GAUSS procedure czt.gss is available from my website.
The decision whether to use the simple summation (42) m times,
or whether to apply the chirp-z transform (46) depends on the desired
number of strikes m. The speed of the former relative to the latter is
roughly m/6/(log
2
m + 1) times higher. As a rough guide, for m 36
the simple summation (42) is as fast as the chirp-z formula (46), for
m = 8 it is three times faster, and for m = 150 it is three times slower.
One also has to decide whether to force the FFT spacing of strike
values (47); this is done by boosting n while keeping 4v xed. Suppose
that v
max
is chosen su!ciently high to achieve desired accuracy for a
single strike. As a rule of thumb, if the initial spacing
2Z
Imvmax
is six
times coarser that the desired spacing of log strikes 4i one should
use the chirp-z transform, otherwise it will be faster to increase n to
satisfy (47) and use the short FFT algorithm described in Bailey and
Schwarztrauber [2004, pp. 392-393].
The value of Imv
max
tends to be higher for short maturities, and for
parametric distributions with heavy tails, such as variance gamma or
generalized hyperbolic. In such circumstances FFT formula (46)-(47) is
preferable. Non-parametric empirical equity return distributions have
26 A.
Cern y
characterisitic functions that decay faster, leading to lower values of
Imv
max
, leaving the chirp-z transform as the best option.
4. Conclusions
The present paper makes three contributions. It explains the work-
ing of the discrete Fourier transform in a non-technical language in
the familiar binomial option pricing model. Secondly, it highlights the
common perils in the computer implementation of fast DFT algorithms.
Thirdly, it explains how the binomial pricing formula relates to more
complex continuous-time models which allow for excess kurtosis, sto-
chastic volatility and leverage eects and which are used routinely in
the nance industry.
The present paper does not give an exhaustive account of DFT in
Finance. One can quite easily extend the Fourier pricing formula from
binomial lattice of Part I to multinomial lattices, see
Cern [2004,
Chapter 12]. Further applications of FFT appear in Albanese et al
[2004], Andreas et al. [2002], Benhamou [2002], Chiarella and El-Hassan
[1997], Dempster and Hong [2002], and Rebonato and Cooper [1998].
For the most up-to-date developments in option pricing using (contin-
uous) Fourier transform see Carr and Wu [2004], and for evalution of
hedging errors refer to
Cern [2003] and Hubalek et al [2004].
5. Appendix
5.1. Inverse Discrete Fourier Transform
To show F
31
(F (a)) = a we need to prove that for b = F (a) dened
in (11) we have F
31
(b) = a. Denote a = F
31
(b) and express a from
denition (12)
a
l
=
1
s
n
n31
X
k=0
b
k
z
3kl
n
.
Now substitute for b
k
from (11)
a
l
=
1
n
n31
X
k=0
3
C
n31
X
j=0
a
j
z
jk
n
4
D
z
3kl
n
,
move z
3kl
n
inside the inner summation
a
l
=
1
n
n31
X
k=0
3
C
n31
X
j=0
a
j
z
k(j3l)
n
4
D
,
Introduction to FFT in Finance 27
change the order of summation
a
l
=
1
n
n31
X
j=0
n31
X
k=0
a
j
z
k(j3l)
n
!
,
and take a
j
in front of the inner sum (it does not depend on k)
a
l
=
1
n
n31
X
j=0
a
j
n31
X
k=0
z
j3l
n
k
!
.
By virtue of (8)-(9) the inner sum
P
n31
k=0
z
j3l
n
k
equals 0 for j 6= l and
for j = l it equals n. Consequently
a
l
=
1
n
n31
X
j=0
a
j
n31
X
k=0
z
j3l
n
k
!
= a
l
for all l which proves that F
31
(F (a)) = a.
5.2. Discrete Fourier Transform of Convolutions
We wish to show F(a ~b) =
s
nF(a)F(b). Let us begin by computing
c = a ~b. From the denition (23)
c
j
=
n31
X
k=0
a
j3k
b
k
. (48)
By d denote the Fourier transform of c, d = F(a ~ b) and use the
denition (11) to evaluate d
l
d
l
=
1
s
n
n31
X
j=0
c
j
z
jl
n
.
Now substitute for c
j
from (48),
d
l
=
1
s
n
n31
X
j=0
n31
X
k=0
a
j3k
b
k
!
z
jl
n
,
move z
jl
inside the inner bracket, writing it as a product z
jl
= z
(j3k)l
z
kl
,
d
l
=
1
s
n
n31
X
j=0
n31
X
k=0
a
j3k
z
(j3k)l
b
k
z
kl
,
28 A.
Cern y
change the order of summation,
d
l
=
1
s
n
n31
X
k=0
n31
X
j=0
a
j3k
z
(j3k)l
b
k
z
kl
,
and take b
k
z
kl
in front of the inner summation (it does not depend on
j),
d
l
=
1
s
n
n31
X
k=0
b
k
z
kl
3
C
n31
X
j=0
a
j3k
z
(j3k)l
4
D
. (49)
It is easy to realize that the inner sum does not depend on k, because it
always adds the same n elements; only the order in which these elements
are added depends on k (we are completing one full turn around the
circle, starting at kth spoke). Hence we have:
n31
X
j=0
a
j3k
z
(j3k)l
=
n31
X
j=0
a
j
z
jl
for all k,
and substituting this into (49) we nally obtain
d
l
=
s
n
1
s
n
n31
X
k=0
b
k
z
kl
!
| {z }
b
l
3
C
1
s
n
n31
X
j=0
a
j
z
jl
4
D
| {z }
a
l
.
From the denition of the forward transform (11) a = F(a) and
b =
F(b), which completes the proof.
References
Albanese, C., K. Jackson, and P. Wiberg (2004). A new Fourier
transform algorithm for value at risk. Quantitative Finance 4,
328338.
Andreas, A., B. Engelmann, P. Schwendner, and U. Wystup (2002).
Fast Fourier method for the valuation of options on several cor-
related currencies. In J. Hakala and U. Wystup (Eds.), Foreign
Exchange Risk. Risk Publications.
Bailey, D. H. and P. N. Swartztrauber (1991). The fractional Fourier
transform and applications. SIAM Review 33(3), 389404.
Benhamou, E. (2002). Fast Fourier transform for discrete Asian
options. Journal of Computational Finance 6(1).
Introduction to FFT in Finance 29
Bluestein, L. I. (1968). A linear ltering approach to the computation
of the discrete Fourier transform. IEEE Northeast Electronics
Research and Engineering Meeting 10, 218219.
Carr, P. and D. B. Madan (1999). Option valuation using the fast
Fourier transform. Journal of Computational Finance 2, 6173.
Carr, P. and L. Wu (2004). Time-changed Lvy processes and option
pricing. Journal of Financial Economics 71(1), 113141.