23
University of Houston/Department of Mathematics Dr. Ronald H.W. Hoppe Numerical Methods for Option Pricing in Finance Chapter 2: Binomial Methods and the Black-Scholes Formula 2.1 Binomial Trees One-period model of a financial market We consider a financial market consisting of a bond B t = B(t),a stock S t = S(t), and a call-option C t = C(t), where the trade is only possible at time t = 0 and t = Δt. Assumptions: There is a fixed interest rate r > 0 on the bond with initial value B 0 = 1. Taking proportional yield into account, at t = Δt there holds B Δt = exp(rΔt). There are only two possibilities for the price S Δt of the stock with initial value S = S 0 at time t = Δt: Either S Δt = u · S (up) with probability P(up)= q , 0 < q < 1, or S Δt = d · S (down) with probability P(down)= 1 - q, where u > d > 0. The price of the call-option is K and the maturity date is T. There is no-arbitrage and short sellings are allowed (i.e., selling stocks that are not yet owned but delivered later). There are no transaction costs and no dividends on the stocks.

Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

Embed Size (px)

Citation preview

Page 1: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Chapter 2: Binomial Methods and the Black-Scholes Formula

2.1 Binomial Trees

One-period model of a financial market

We consider a financial market consisting of a bond

Bt = B(t), a stock St = S(t), and a call-option Ct = C(t),

where the trade is only possible at time t = 0 and t = ∆t.

Assumptions:

• There is a fixed interest rate r > 0 on the bond withinitial value B0 = 1. Taking proportional yield into

account, at t = ∆t there holds B∆t = exp(r∆t).

• There are only two possibilities for the price S∆t of

the stock with initial value S = S0 at time t = ∆t:

Either S∆t = u · S (up) with probability P(up) = q , 0 < q < 1, or S∆t = d · S (down) with

probability P(down) = 1 − q, where u > d > 0.

• The price of the call-option is K and the maturity date is T.

• There is no-arbitrage and short sellings are allowed (i.e., selling stocks that are not yet owned

but delivered later). There are no transaction costs and no dividends on the stocks.

Page 2: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Lemma 2.1 The no-arbitrage principle and the possibility of short sellings imply

d ≤ exp(r∆t) ≤ u .

Proof. Assume exp(r∆t) > u. Then, the purchase of a bond by short sellings results in an

immediate profit.

On the other hand, if exp(r∆t) < d, a risk-free profit can be realized by the purchase of the

stock financed by a credit.

Both cases contradict the no-arbitrage principle.

Page 3: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Price of a European Call-Option in the One-Period Model

Value of the call-option at time t = ∆t:

(+) (Up-State) Cu := (uS − K)+ , (Down-State) Cd := (dS − K)+ .

Computation of the price C0 by the duplication strategy:

Buy resp. sell c1 bond and c2 stock such that

()1 c1 · B0 + c2 · S0 = C0 ,

()2 c1 · B∆t + c2 · S∆t = C∆t .

Using (+) in ()2, we obtain the following linear system in c1, c2:

c1 exp(r∆t) + c2 uS = Cu ,

c1 exp(r∆t) + c2 dS = Cd ,

whose solution is given by

(∗) c1 =uCd − dCu

(u − d) exp(r∆t), c2 =

Cu − Cd

(u − d) S.

Page 4: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Price of a European Call-Option in the One-Period Model

Inserting (∗) into ()1 results in

(†) C0 = exp(−r∆t) (pCu + (1 − p)Cp) , p =exp(r∆t) − d

u − d.

Interpretation of the option price as a discounted expectationSince d ≤ exp(r∆t) ≤ u (cf. Lemma 2.1), we have 0 ≤ p ≤ 1. Recalling that the expectation of

a random variable X attaining the states Xu resp. Xd with probability p resp. 1 − p is given by

Ep(X) = p Xu + (1 − p) Xd ,

from (†) we deduce

C0 = exp(−r∆t) Ep((S∆t − K)+) .

In view ofEp(S∆t) = p u S + (1 − p) d S = exp(r∆t) S ,

p can be interpreted as a risk-neutral probability (the expected value of the asset with probabi-

lity p of the up-state equals the profit from the risk-free bond).

Page 5: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Price of a European Call-Option in the n-Period Model (Cox-Ross-Rubinstein Model)

n-period model of a financial market

Under the same assumptions as before, we consider

an n-period model of the financial market where for

each time interval of length ∆t the value of the stock

may change by the factor u with probability q and by

factor d with probability 1 − q. Hence, assuming k

up-states and n − k down-states, the value of the stock

at maturity date T = n∆t,n ∈ lN, is given by

Snk := uk dn−k S .

Theorem 2.2 (Cox-Ross-Rubinstein Model)

The price C0 of a European call-option in the n-period model is

C0 = exp(−rn∆t)n

k=0

n

k

pk (1 − p)n−k (Snk − K)+ .

Proof. The proof is by induction (Exercise).

Page 6: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Discrete Black-Scholes Formula

We may interpret

n

k

pk (1 − p)n−k

as the probability that the stock attains the value Snk at time T = n∆t and

Ep(X) =n

k=0

n

k

pk (1 − p)n−k Xk

as the expectation of a random variable X which attains the state Xk,0 ≤ k ≤ n, with probabi-

lity(nk

)

pk (1 − p)n−k. Hence, the option price C0 can be written as the discounted expectation

(‡) C0 = exp(−rT) Ep((Sn− K)+) .

Theorem 2.3 (Discrete Black-Scholes Formula)

With m := min 0 ≤ k ≤ n | ukdn−kS − K ≥ 0 and p′ := pu exp(−r∆t) there holds

C0 = S Φ(m,p′) − K exp(−rT) Φ(m,p) , Φ(m,p) =n

k=m

n

k

pk (1 − p)n−k.

Proof. The proof follows readily from (‡) observing 1 − p′ = (1 − p) d exp(−r∆t).

Page 7: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

2.2 A Stochastic Model for the Value of a StockDefinition 2.1 (Wiener Process, Brownian Motion)

Let (Ω,F ,P) be a probability space, i.e., Ω is a set, F ⊂ P(Ω) is a σ-algebra with P(Ω) being

the power set of Ω, and P : F → [0,1] is a probability measure on F .

A Wiener process or Brownian motion is a continuous stochastic process Wt = W(·, t) where

W : Ω × lR+ → lR with the properties

(W1) W0 = 0 almost sure, i.e., P(ω ∈ Ω | W0(ω) = 0) = 1.

(W2) Wt ∼ N(0, t), i.e., Wt is N(0, t)-distributed. This means that for t ∈ lR+ the random variable

Wt is normally distributed with mean E(Wt) = 0 and variance Var(Wt) = E(W2t ) = t.

(W3) All increments ∆Wt := Wt+∆t − Wt on non-overlapping time intervals are independent,

i.e., Wt2 − Wt1 and Wt4 − Wt3 are independent for all 0 ≤ t1 < t2 ≤ t3 < t4.

Theorem 2.4 (Properties of a Wiener Process)A Wiener process Wt has the properties that for all 0 ≤ s < t there holds

(i) E(Wt − Ws) = 0 (ii) Var(Wt − Ws) = E((Wt − Ws)2) = t − s .

Page 8: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

A Discrete-Time Model of a Wiener Process

For the discrete times tm := m∆t,m ∈ lN, where ∆t > 0, the value Wt of a Wiener process can

be written as the sum of independent and normally distributed increments ∆Wk according to

Wm∆t =m∑

k=1(Wk∆t − W(k−1)∆t)︸ ︷︷ ︸

=: ∆Wk

,

Increments ∆Wk with such a distribution and Var(∆Wk) = ∆t can be computed from standard

normally distributed random numbers Z, i.e.,

Z ∼ N(0,1) =⇒ Z ·

∆t ∼ N(0,∆t) .

This gives rise to the following discrete model of a Wiener process

∆Wk = Z√

∆t , where Z ∼ N(0,1) .

Remark: The computation of Z will be explained in Chapter 4.

Page 9: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Discrete-Time Model of a Wiener Process with ∆t = 0.0002

Realization of a Wiener process; courtesy of [Gunter/Jungel]

Page 10: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Dow Jones Index at 500 trading days from Sept. 8, 1997 to August 31, 1999

Page 11: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

A Stochastic Model for the Value of a Stock

Idea: Consider a bond Bt with risk-free interest rate r > 0 and proportional yield.

Then, there holds Bt = B0 exp(rt) which is equivalent to

ln Bt = ln B0 + r · t .

Taking into account the uncertainty of the stock market, for the value St of the stock we assume

ln St = ln S0 + b · t + ′uncertainty′

.

As far as the uncertainty is concerned, we assume that it has expectation 0 and is N(0, σ2t)-

distributed which, in view of Var(σWt) = σ2t, suggests

(⊙) ln St = ln S0 + b · t + σ Wt .

Definition 2.2 (Geometric Brownian Motion) Setting µ := b + σ2/2, we deduce from (⊙)

(⋆) St = S0 exp(µt + σ Wt −1

2 t) .

St is called a geometric Brownian motion. Note that St is log-normally distributed.

Page 12: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Lemma 2.2 Properties of geometric Brownian motions

For the geometric Brownian motion St a given in Definition 2.2 there holds

(i) E(St) = S0 exp(µt) ,

(ii) Var(St) = S20 exp(2µt) (exp(σ2t) − 1) .

Proof. Since Wt is N(0, t)-distributed, we have

E(exp(σWt)) =1

2πt

lRexp(σx) exp(−x2

/2t) dx =

=1

2πtexp(σ2t/2)

lRexp(−(x − σt)2/2t) dx = exp(σ2t/2) ,

whenceE(St) = S0 exp(µt − σ

2t/2) E(exp(σWt) = S0 exp(µt) .

Moreover, we obtain

Var(St) = E(S2t ) − E(St)

2 = S20 exp((2µ − σ

2)t) E(exp(2σWt)) − S20 exp(2µt) =

= S20 exp(2µt) (exp(σ2t) − 1) .

Page 13: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

2.3 The Continuous Black-Scholes FormulaWe recall that in an n-period model the price of a European call-option is given by

C0 = S P(Xp′ ≥ m) − K exp(−rT) P(Xp ≥ m) ,

where m = min0 ≤ k ≤ n | ukdn−kS − K ≥ 0 and Xp′ resp. Xp are B(n,p′) resp. B(n,p)-distri-

buted random variables with

p =exp(r∆t) − d

u − d, p′ = p u exp(−r∆t) .

Theorem 2.5 (Continuous Black-Scholes Formula)

Assume that T = n ∆t , u > 1 , d = 1/u and define σ > 0 such that u = exp(σ√

∆t) and

d = exp(−σ

∆t). Then, there holds

lim∆t→0

C0 = S Φ(d1) − K exp(−rT) Φ(d2) , Φ(x) :=1

x∫

−∞

exp(−s2/2) ds ,

where d1 , d2 are given by

d1 =ln(S/K) + (r + σ

2/2)T

σ

T, d2 =

ln(S/K) + (r − σ2/2)T

σ

T.

Page 14: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Proof. It is sufficient to verify

lim∆t→0

P(Xp ≥ m) = Φ(d2) , lim∆t→0

P(Xp′ ≥ m) = Φ(d1) .

We prove the first assertion and leave the second one as an exercise.

To this end, we reformulate P(Xp ≥ m) according to

(⊕) P(Xp ≥ m) = 1 − P(Xp < m) = 1 − P(Xp − np

np(1 − p)<

m − np√

np(1 − p)) .

In view of the definition of m, we have

m ln u + (n − m) ln d ≥ lnK

S⇐⇒ m ≥ −

ln(S/K) + n ln d

ln(u/d).

We choose 0 ≤ α < 1 such that

(•) m = −

ln(S/K) + n ln d

ln(u/d)+ α .

Inserting (•) into (⊕) gives

(⊗) P(Xp ≥ m) = 1 − P(Xp − np

np(1 − p)) <

−ln(S/K) − n(p ln(u/d) + ln d) + α ln(u/d)

ln(u/d)√

np(1 − p)) .

Page 15: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

We apply the central limit theorem for B(n,p)-distributed random variables to (⊗).

Theorem 2.6 (Central Limit Theorem for B(n,p)-Distributed Random Variables)

For a sequence (Yn)n∈lN of B(n,p)-distributed random variables in a probability space there holds

(∗) limn→∞

P(Yn − np

np(1 − p)≤ x) = Φ(x) =

1√

x∫

−∞

exp(−s2/2) ds .

Continuation of the proof of Thm 3.5. In order to apply (∗), we have to evaluate the limits

lim∆t→0

n p (1 − p) (lnu

d)2 , lim

∆t→0n (p ln

u

d+ ln d) .

Taylor expansion of p as a function of ∆t around 0 yields

p =exp(r∆t) − exp(−σ

∆t)

exp(σ√

∆t) − exp(−σ

∆t)=

σ + (r − σ2/2)

∆t + O(∆t)

2σ + O(∆t),

whence() lim

∆t→0p =

1

2, lim

∆t→0

2p − 1√

∆t=

r

σ

σ

2.

Page 16: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

An immediate consequence of () is

lim∆t→0

n p (1 − p) (lnu

d)2 = lim

∆t→0

T

∆tp(1 − p)(2σ

∆t)2 = lim∆t→0

4p(1 − p) σ2 T = σ

2 T ,

lim∆t→0

n (p lnu

d+ ln d) = lim

∆t→0

T√

∆t(2p − 1) σ = (r −

σ2

2) T .

Now, the application of the central limit theorem (Theorem 2.6) results in

P(Xp ≥ m) → 1 − Φ(−ln(S/K) − (r − σ

2/2) T

σ

T) .

Observing 1 − Φ(−x) = Φ(x) finally allows to conclude:

P(Xp ≥ m) → Φ(ln(S/K) + (r − σ

2/2) T

σ

T) = Φ(d2) .

Page 17: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

2.4 The Binomial MethodThe binomial method provides an algorithmic tool for the computation of an approximation of

the price of a European or an American option.

We partition the time interval [0,T] into N equidistant subintervals of length ∆t = T/N,N ∈ lN,

and compute approximations Sti = STi,0 ≤ i ≤ N, at times ti = i ∆t.

We make the following assumptions:

• The value of the stock at time ti+1 is either Si+1 = u Si with probability p ∈ (0,1) (’up’) or it

is Si+1 = d Si with probability 1 − p (’down’).

• The expected profit within ∆t corresponds to the risk-free interest, i.e., with µ = r we obtain

(⋆) E(S(ti+1)) = S(ti) exp(r∆t) , Var(S(ti+1)) = S(ti)2 exp(2r∆t) (exp(σ2 ∆t) − 1) .

Likewise, for the option price V(ti) we assume

(⋆⋆) E(V(ti+1)) = V(ti) exp(r∆t) .

• There are no transaction costs and there are no dividends on the stocks.

Page 18: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Specification of the parameters u,d,p

The three parameters u,d and p in the binomial method can be determined by a nonlinear sys-

tem of three equations. Two of these equations can be obtained by assuming that the expecta-

tion and variance of the value of the stock at ti+1 coincide for the time-continuous model and

the time-discrete model. For the time-discrete model, we have

E(Si+1) = p · u Si + (1 − p) · d Si ,

Var(Si+1) = p (uSi)2 + (1 − p)(dSi)

2− (puSi + (1 − p)dSi)

2.

Replacing S(Ti) by Si in (⋆) yields

() Si exp(r∆t) = p · u Si + (1 − p) · d Si ,

() S2i exp(2r∆t) (exp(σ2∆t) − 1) = p (uSi)

2 + (1 − p)(dSi)2− (puSi + (1 − p)dSi)

2.

The two equations (), () have to be complemented by a third one. There are two options:

Variant I: ( ) u · d = 1 (symmetry w.r.t. ’up’ and ’down’)

Variant II: ( ) p = 12 (same probability for ’up’ and ’down’)

Page 19: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Variant I: The solution of (), (), ( ) is given by

u = β +√

β2− 1 , d = β −

β2− 1 ,

p =exp(r∆t) − d

u − d, β =

1

2(exp(−r∆t) + exp((r + σ

2)∆t)) .

Variant II: In this case, the solution of (), (), ( ) turns out to be

u = exp(r∆t) (1 +√

exp(σ2∆t) − 1) ,

d = exp(r∆t) (1 −

exp(σ2∆t) − 1) ,

p =1

2.

Page 20: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Algorithm 2.1: Binomial Method

Denoting by S0 the value of the stock at t = 0 and setting Sji := uj di−jS0 , 0 ≤ i ≤ N,0 ≤ j ≤ i,

we proceed as follows

Step 1: Initialization of the binomial tree

For j = 0,1, ...,N computeSjN = uj dN−j S0 .

Step 2: Computation of the option prices

For j = 0,1, ...,N compute

VjN =

(SjN − k)+ , Call

(K − SjN)∗ , Put.

Step 3: Backward Iteration

We remark that in terms of Sji, the first equation () can be written as

Sji exp(r∆t) = p u Sji + (1 − p) d Sji = p Sj+1,i+1 + (1 − p) Sj,i+1 .

Page 21: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Step 3: Backward Iteration (Continuation)

If we replace the option price V(ti) in () by its discrete counterpart Vi, we obtain

Vji exp(r∆t) = p Vj+1,i+1 + (1 − p) Vj,i+1 .

Consequently, the backward iteration is implemented as follows:

For i = N − 1,N − 2, ...,0 and j = 0,1, ..., i compute

Vji = exp(−r∆t) (p Vj+1,i+1 + (1 − p) Vj,i+1)

in case of European option and

Vji = exp(−r∆t) (p Vj+1,i+1 + (1 − p) Vj,i+1) ,

Vji =

max(Sji − K)+, Vji , Call

max(K − Sji)+, Vji , Put

.

for an American option.

Page 22: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

2.6 Implementation of the Binomial Method in MATLAB

The MATLAB program binbaum1.m

computes the price of an European

put option according to the binomial

method.The input parameters have to be

specified by the user.

The commands will be sequentially

compiled and executed by the

MATLAB interpreter.

For appropriate outputs see the

MATLAB handbook.

%Input parameters

K = ;S0 = ; r = ; sigma = ;T = ;N = ;% Computation of u,d,pbeta = 0.5 ∗ (exp(−r ∗ dt) + exp((r + sigma 2) ∗ dt));u = beta + sqrt(beta 2 − 1);d = 1/u;p = (exp(r ∗ dt) − d)/(u − d);%First step

for j = 1 : N + 1

S(j,N + 1) = S0 ∗ uˆ(j − 1) ∗ dˆ(N − j + 1)end

%Second step

for j = 1 : N + 1

V(j,N + 1) = max(K − S(j,N + 1),0);end

%Third step

e = exp(−r ∗ dt);for i = N : −1 : 1

for j = 1 : iV(j, i) = e ∗ (p ∗ V(j + 1, i + 1) + (1 − p) ∗ V(j, i + 1));

end

end

%Output

fprintf(′V(%f ,0) = %f \ n′, S0, V(1,1))

Page 23: Chapter 2: Binomial Methods and the Black-Scholes …rohop/spring_13/Chapter2.pdfChapter 2: Binomial Methods and the Black-Scholes Formula ... a stock St = S(t), ... 2.2 A Stochastic

University of Houston/Department of MathematicsDr. Ronald H.W. Hoppe

Numerical Methods for Option Pricing in Finance

Vectorized MATLAB program binbaum2.m

The MATLAB program binbaum2.m

computes the price of an European

put option by a vectorized version

of the binomial method.For large N, the vectorized version

is by orders of magnitude faster than

the standard version binbaum1.m.

function V = binbaum2(S0,K, r, sigma,T,N)% Computation of u,d,pdt = T/N;beta = 0.5 ∗ (exp(−r ∗ dt) + exp((r + sigmaˆ2) ∗ dt));u = beta + sqrt(betaˆ2 − 1);d = 1/u;p = (exp(r ∗ dt) − d)/(u − d);%First step

S = S0 ∗ (u.ˆ(0 : N)′. ∗ d.ˆ(N : −1 : 0)′

%Second step

V = max(K − S,0);end

%Third step

q = 1 − p;for i = N : −1 : 1

V = p ∗ V(2 : i + 1) + q ∗ V(1 : i);end

%Output

V = exp(−r ∗ T) ∗ V;