Vous êtes sur la page 1sur 36

Computational Finance

Computational Finance p. 1

Outline
Binomial model: option pricing and optimal investment
Monte Carlo techniques for pricing of options
pricing of non-standard options
improving accuracy of Monte Carlo method
solving Stochastic Differential Equations (SDE)
pricing of exotic options
pricing of options in stochastic volatility models
Partial Differential Equations (PDE)
numerical methods
the Black-Scholes equation for non-standard options

Computational Finance p. 2

Literature
Rdiger Seydel, Tools for Computational Finance, Third Edition, Springer,
2006
John C. Hull, Options, Futures, and Other Derivatives, Sixth Edition,
Prentice Hall, 2006
John C. Hull, Options, Futures, and Other Derivatives, Fifth Edition,
Prentice Hall, 2003
Justin London, Modeling Derivatives in C++, Wiley Finance, 2005
Paul Glasserman, Monte Carlo Methods in Financial Engineering,
Springer, 2004

Computational Finance p. 3

Lecture 1

Discrete Time Finance


Lecture Notes
by Jan Palczewski
with additions
by Andrzej Palczewski

Computational Finance p. 4

Discrete Time Finance


1. Time t = 0, 1, 2, . . . , T .
2. A probability space (, P) with the filtration (Ft )t=0,...,T .
3. A money market account (Bt ), which evolves according to Bt = (1 + r)t
or Bt = ert .
4. A risky financial asset whose price is given by a stochastic process
St

t=0,...,T

which is assumed to be (Ft )-adapted.


5. A family T of adapted self-financing trading strategies.
6. Risk neutral probability measure.

Computational Finance p. 5

Binomial model
2
S
=
S
u
2
0
3
3
f
f
ffffff
S188 = S0 u XXX1pu
XXXXX++
p
pu ppp
p
p
S2 = S0 ud
p
p
p
pp
S0 NN
NNN
N1p
NNNu
pu ff33 S2 = S0 du
NN&&
ffffff
S1 = S0 d XXX1pu
XXXXX
++
S2 = S0 d2
pu

B0 = 1

// B1 = 1 + r

// B2 = (1 + r)2

Parameters: u, d, r, S0 , p.

Computational Finance p. 6

We change the Binomial Model slightly. We do not assume that the time
elapsing between two consecutive stock price movements is 1, but we
choose a time step, which we denote by t. The terminal time T is constant.
Thus, the smaller t the more accurate the model (it has more time periods
squeezed into the interval [0, T ]). These are our time points:
i t,

T
.
i = 0, 1, 2, . . . ,
t

We will use the notation Si = Si t , Bi = Bi t .


For the sake of consistency we shall assume that
Bi = er it ,
so
Bi+1
= ert .
Bi

Computational Finance p. 7

A new binomial model


2
S
=
S
u
2
0
3
3
g
ggggg
= S0 u WW1pu
WWWW++
S2 = S0 ud
pu

S188
q
pu qqq
q
q
q
q
qqq
S0 MM
MMM 1p
MMM u
MMM
pu g33 S2 = S0 du
&&
ggggg
S1 = S0 d WW1pu
WWWW++
S2 = S0 d2
B0 = 1

// B1 = ert

// B2 = e2rt

Parameters: u, d, r, S0 , p.

Computational Finance p. 8

Properties
In the Binomial Market Model
Si ()
{u, d},
Si1 ()

We assume that u > d.


Theorem. The model is arbitrage free if and only if
u > ert > d.

Theorem. If the model is arbitrage free, then it is complete.

Computational Finance p. 9

Explanation
If there is only one risky asset in the multi period market model then:
There are no arbitrage if and only if all the constituent single period
models are arbitrage-free.
All risk neural measures can be computed by considering constituent
single period market models.
Single period market models give conditional probabilities for risk neutral
measures.
Single period market models can be used to compute prices of
contingent claims.

Computational Finance p. 10

Contingent claims
European path-independent options
payoff given by h(ST )
European call and put options
European binary call and put options
European path-dependent options
Asian options (calls and puts on the average of the stock price)
Barrier options
Lookback options
American options
they can be exercised anytime before or at maturity
the payoff at the exercise moment t is h(St )

Computational Finance p. 11

Pricing of European options - first draft


'

Input: u, d, r, S0 , T , M (number of periods).

Compute one-period risk neutral probability p .


Construct a tree.
Compute values in the leaves of the tree (payoffs).
For i from M 1 to 0 do
compute values in each node in the period i using one-period
binomial formula (using p ) and using values computed
in the previous step
Output: the value in the root of the tree is the price of the option

&

In above sketch of the algorithm the period length t is equal to

T
M.
Computational Finance p. 12

Computational complexity
Computational complexity plays a major role in the construction of numerical
algorithms. It says how the amount of resources required by the algorithm
grows with the size of the problem (eg. number of periods in the Binomial
Model). There are two main types of resources:
memory (RAM)
time
For the algorithm from the previous slide
memory requirement is proportional to 2M +1
time is proportional to 2M +1

Computational Finance p. 13

Computational complexity made practical


Why is the computational complexity so important?
Assume that one byte is enough for each node. To simulate M = 100 periods
we need
2101 Bytes = 291 kBytes = 281 MBytes = 261 TBytes (!)

Path-independent options: the values in many of nodes of the tree are


identical (for a simple example draw a tree for n = 3). We can glue identical
nodes into one node -> recombining binomial tree.

Computational Finance p. 14

Recombination of the binomial tree

S0

k55
k
k
kk
k
S0 u4 Q
5
5
k
QQQ
k
k
k
k
QQQ
k
k
((
6
6
S0 u3 TT
m
5
5
k
mm
TTTT
k
m
k
m
k
m
))
kk
2
3
S0 u d
5
5
66 S0 u SSSS
QQQ
k
m
k
m
k
m
S
k
m
QQQ
S
k
))
k
mm
((66
2
S0 u R
S
u
d
m
0
6
6
T
m
5
5
RRRR
TTTT
m
nn
kk
m
k
n
m
k
T
n
R
m
k
))
((
k
nn
2 2
S0 ud S
S
u
d
PPP
0
6
6
5
5
S
QQQ
m
k
S
m
k
PPP
S
k
m
S
k
m
S
QQQ
k
))
k
((
mm
((66
2
S0 d R
S0 ud T
m
m
5
5
RRR
TTTT
kk
mm
k
RR((
m
k
T
m
k
))
k
2
S0 d S
S0 ud3
5
5
SSS
QQQ
kk
k
k
SS))
QQQ
k
kk
((66
3
S0 d TT
m
m
TTTT
mm
m
m
T))
m
4
S0 d SS
SSSS
S))

Recombining tree can only be used to price path independent options and
American options!!!!!
Computational Finance p. 15

Recombination of the binomial tree

S00

66 S11
l
l
llll
RRRR
RR((
S01

66 S22
l
l
llll
RRRR
RR((
66 S12
l
l
llll
RRRR
RR((
S02

66 S33
l
l
l
lll
RRRR
RR((
66 S23
l
l
llll
RRRR
RR((
66 S13
l
l
llll
RRRR
RR((
S03

66 S44
l
l
llll
RRRR
RR((
66 S34
l
l
llll
RRRR
RR((
66 S24
l
l
llll
RRRR
RR((
66 S14
l
l
l
lll
RRRR
RR((
S04

66
l
l
l
lll
OOO
OOO
''
7
7
o
oo
o
o
o
OOO
OOO
''
7
7
o
oo
o
o
o
OOO
OOO
77''
o
o
o
ooo
OOO
OOO
''
7
7
o
oo
o
o
o
RRRR
RR((

Recombining tree can only be used to price path independent options and
American options!!!!!
Computational Finance p. 16

Properties
Denote by Sji the price after i periods with j being the number of up moves:
Sji = S0 uj dij .
Theorem. There exists a risk neutral measure (probability) given by the
formula
ert d

p =
ud

Under this measure disconted stock prices erit S(it) form a martingale,
i.e.


Sji = ert p Sj+1,i+1 + (1 p )Sj,i+1

Computational Finance p. 17

Pricing contingent claims


Let h be the payoff function and Vji denote the value process of the
replicating strategy as known in the node Sji . Then
VjM = h(SjM ),

j = 0, 1, . . . , M.

European options: computation:





rt
p Vj+1,i+1 + (1 p )Vj,i+1
Vji = e
American options: computation:




rt
p Vj+1,i+1 + (1 p )Vj,i+1 .
Vji = max h(Sji ), e

Computational Finance p. 18

European options

'

Input: u, d, r, S0 , T , M (number of periods).

t = T /M,

ert d
p =
ud

S00 = S0
SjM = S00 uj dM j ,

j = 0, 1, . . . , M

For j from 0 to M do

VjM = h(SjM )

For i from M 1to 0 do

rt
p Vj+1,i+1 + (1 p )Vj,i+1
Vji = e

Output: V00

&

Computational Finance p. 19

American options

'

Input: u, d, r, S0 , T , M (number of periods).

t = T /M,

ert d
p =
ud

S00 = S0
For i from 0 to M
For j from 0 to i do Sji = S00 uj dij
For j from 0 to M do

VjM = h(SjM )

For i from M 1 to 0 do

rt
p Vj+1,i+1 + (1 p )Vj,i+1
Vji = max h(Sji ), e

Output: V00

&

Computational Finance p. 20

Computational complexity
For the algorithm from the previous slide
memory size is proportional to
time is proportional to

(M +1)(M +2)
,
2

(M +1)(M +2)
,
2

which means it grows like M 2

which means it grows like M 2

To simulate M = 100 periods we need


101 102/2 = 5151 nodes.

Is there any hope for path-dependent options? Yes, Monte Carlo methods.

Computational Finance p. 21

Binomial model in practice


2
S
=
S
u
2
0
3
3
g
ggggg
= S0 u WW1pu
WWWW++
S2 = S0 ud
pu

S188
q
pu qqq
q
q
q
q
qqq
S0 MM
MMM 1p
MMM u
MMM
pu g33 S2 = S0 du
&&
ggggg
S1 = S0 d WW1pu
WWWW++
S2 = S0 d2
B0 = 1

// B1 = ert

// B2 = e2rt

Parameters:
unknown: u, d, pu

known: r, S0
Computational Finance p. 22

Calibration of the model


The parameters r and S0 can be observed on financial markets, but the
parameters u and d are only model idealizations and cannot be directly
determined by observation of the real world data. We need to construct an
algorithm to find u and d. It is called calibration of the model.
People trading in stock markets study a different parameter, which they call
volatility, and which reflects a property of the continuous time model, known
as the Black-Scholes model. In the Black-Scholes model asset prices follow
the dynamics
( 21 2 )t+Wt

St = S0 e

S0 > 0,

where Wt is a Brownian Motion, is a volatility and is a growth rate.

Computational Finance p. 23

Distribution of returns
For > 0
log

where N (

1 2
2

),

St+
St



1 2
2
N ( ), ,
2

stands for a normal distribution with the mean


1
( 2 )
2

and the variance


2 .
We wish to compute the volatility (in the risk neutral world the knowledge of
is not needed).

Computational Finance p. 24

Estimation of the volatility of a stock price: The stock price is usually


observed at fixed intervals of time (e.g. every day, week, or month). Define
n + 1 the number of observations (numbered 0, 1, . . . , n);
Si observed stock price at the end of i-th interval, i = 0, 1, . . . , n;
length of time interval in years (can be different from t in the
binomial model).
Let
Si
,
ui = log

Si1

i = 1, . . . , n.

The usual estimate of volatility requires computation of the empirical


variance:
n
X
1
(ui u
)2 ,
s2 =
n 1 i=1
where

1X
u
=
ui .
n i=1
Computational Finance p. 25

From the equation


log

St+
St


1 2
2
N ( ), ,
2

the empirical variance s2 is an estimate for 2 . Therefore, we have


s

with the standard error approximately equal to

.
2n

Standard error measures the precision of computation. It is a main building


block for confidence intervals.
The rule of thumb: to get the precision of e.g. 0.1% we need the standard
error smaller than 0.1%/1.96.
Computational Finance p. 26

Trading Days vs. Calendar Days


An important issue is whether time should be measured in calendar days or
trading days when volatility parameters are estimated and used. Practitioners
tend to ignore days when the exchange is closed while estimating volatility
from historical data. The number of trading days in a year is approximately
equal to 252. Therefore,
when using prices from consecutive trading days, take =

1
252

when using prices from consecutive weeks (Mondays, Tuesdays, etc.),


5
take = 252

Computational Finance p. 27

Binomial Model Calibration


so far we have computed the volatility of the stock price in the
Black-Scholes model
we do not know the growth rate
we do not need the growth rate, because pricing is done with respect to a
risk-neutral measure under which:
1

St = S0 e(r 2

)t+Wt

where r is a risk-free interest rate.


Find u and d such that under a risk-neutral measure p the one period
expectation and variance in the Binomial Model agree with the Black-Scholes
model under its risk-neutral measure.

Computational Finance p. 28

E and V ar in Black-Scholes
Let t be the length of one period in the Binomial Model.
The Black-Scholes model under a risk-neutral measure:
1

St = S0 e(r 2

)t+Wt

The conditional variance of St+t given St is equal to


 2

V ar(St+t |St ) = St2 e2rt e t 1 .
The conditional expectation of St+t given St is equal to
E (St+t |St ) = St ert .

Computational Finance p. 29

E and V ar in Binomial Model


Remember that t is the length of one period in the Binomial Model.
The conditional expectation of St+t given St is


E (St+t |St ) = St p u + (1 p )d .

The conditional variance of St+t given St in a binomial model with the


period length t, parameters r, u, d and the risk neutral probability of the up
move equal to p is
V ar(St+t |St ) =

2
E (St+t
|St )
2

E (St+t |St )
2

= p (St u) + (1 p )(St d)

2

St2

2

p u + (1 p )d .

Computational Finance p. 30

How they meet


Expectation
St p u + (1 p )d = St ert

Variance
p (St u)2 + (1 p )(St d)2 St2 p u + (1 p )d

2

= St2 e2rt


e t 1
2

After simplification:
p u + (1 p )d = ert
2

2rt+ 2 t

p u + (1 p )d = e

Computational Finance p. 31

The story is not finished yet


p u + (1 p )d = ert
2

2rt+ 2 t

p u + (1 p )d = e

There are two equations with three unknowns, so we may expect more than
one solution.
The following relation follows from the first equation
ert d
.
p =
ud

Possible solutions:
u = d1 leads to the Cox-Ross-Rubinstein model industry standard
p = 1 p = 1/2 leads to the Jarrow-Rudd model also quite popular
Computational Finance p. 32

Cox-Ross-Rubinstein (CRR)
Assume that u = d1 . We obtain the following set of parameters
p
u = + 2 1,
p
d = 1/u = 2 1,
where


2
1  rt
e
+ e(r+ )t .
=
2

In practice, there is a tendency to use a simplified version of the CRR model.


It can be shown that up to the terms of higher order, we can set

u=e

d = 1/u = e

and p computed as the risk neutral measure for these u and d.


Computational Finance p. 33

Jarrow-Rudd (JR)
Assume now that p = 21 . This leads to the following parameters
rt

u=e

d = ert


1+
1 ,
p

2 t

1 .
1 e
e2 t

The most popular approximate version for the Jarrow-Rudd model is

(r 2 /2)t+ t

u=e

(r 2 /2)t t

d=e

,
.

Observe that the CRR tree is symmetric (due to ud = 1) and the JR tree is
2
skewed since ud = e(2r )t .

Computational Finance p. 34

General binomial tree


Assume
ud = e2t ,
where is some scalar.
This leads to the following approximate solution (exact solution is rather
complicated):

t+ t

u=e

t t

d=e

 
1
1
p = +
t.
2 2

where = r 2 /2.
Observe that for = 0 we obtain the approximate version of the CRR model
and for = , the JR model.
Computational Finance p. 35

'

Input: market data, number of periods M , payoff function h, exercise time T

t = T /M
Calibrate the model to the market data: S0 , r, u, d, p
S00 = S0
SjM = S00 uj dM j ,

j = 0, 1, . . . , M

(for American options) Sji = S00 uj dij for i = 0, 1, . . . , M 1, and j = 0, 1, . . . i


For j from 0 to M do

VjM = h(SjM )

For i from M 1 to 0 do

rt
p Vj+1,i+1 + (1 p )Vj,i+1
(European) Vji = e

(American) Vji = max h(Sji ), ert p Vj+1,i+1 + (1 p )Vj,i+1

Output: V00 the price

&

Computational Finance p. 36

Vous aimerez peut-être aussi