Ulj FMF Fc2 Fm2 Sno Black Scholes Model 01

Download as pdf or txt
Download as pdf or txt
You are on page 1of 60

The Black Scholes model

Antonino Zanette
University of Udine
[email protected]

1
Continuous Stochastic Processes

The origin of stochastic processes can be traced back to the field of statistical
physics. A physical process is a physical phenomenon whose evolution is
studied as a function of time.

In a financial framework, the idea is to give a model of stock price


fluctuations in continuous time.

Definition
Let (Ω, F , P) be a probability space. A continuous-time stochastic process is a family (Xt )t≥0 of
R-valued random variables on (Ω, F , P).
• the index t stands for the time.
• for each time t fixed:
Xt : Ω −→ R

• for each ω ∈ Ω the map t −→ Xt (ω) is called the path of the process.

2
Brownian motion
In finance, the most common models are constructed on the Brownian
motion.
Definition
A Brownian motion is a real-valued, continuous stochastic process (Xt )t≥0 with indipendent,
normally distribuited and stationary increments. In other words :
P1 B0 = 0.
P1 the function s 7→ Bs (ω) is a continuous function.
P2 indipendent increments : for each k, 0 ≤ t0 < t1 < . . . < tk , the increments
Bt0 , Bt1 − Bt0 , Bt2 − Bt1 , .., Btk − Btk−1 are indipendent.

P3 for each t > s ≥ 0, Bt −hBs ∼ N (0, ti− s) ⇒


EP (Bt − Bs ) = 0 and EP (Bt − Bs )2 = t − s.
In particular for s = 0 it follows that EP (Bt ) = 0 e V ar(Bt ) = t.
A particle that is undergoing a Brownian motion Bt has the following property.
P2 Absence of memory.
P3 The mean of Bt − Bs is 0, so there is not a privilegiate direction.
The variance of the particle movement is proportional to the observed time.

3
Brownian motion
The path of the Brownian motion are continuous, but not differentiable.

0.5

0 0.5 1

4
Financial example 2
h i
−rT σB
P =e EP (K − e T )+ .

with BT B.M a time T .


We consider a put option with underlying asset
σBt
St = e


Under P, BT ∼ N (0, T ). So BT = g T con g ∼ N (0, 1).
We can approximate the put price with

−rT f (X1 ) + · · · + f (Xn )


P ≈e
n
X1 , .., Xn ∼ N (0, T ).

5
Monte Carlo algorithm

main()
{
double mean_price,mean2_price,brownian,price,price_sample,error_price,inf_price,sup_price;
mean_price= 0.0;
mean2_price= 0.0;
for(i=1;i<=N;i++)
{
/*Brownian motion simulation*/
brownian=gaussian()*sqrt(T);

price_sample=MAX(0.0,K-exp(sigma*brownian));

mean_price= mean_price+price_sample;
mean2_price= mean2_price+SQR(price_sample);
}
/* Price */
price=exp(-r*T)*(mean_price/N);
error_price= sqrt(exp(-2.*r*T)*mean2_price/N - SQR(price))/sqrt(N-1);
inf_price= price - 1.96*(error_price);
sup_price= price + 1.96*(error_price);
}

6
Simulation of Brownian motion path
T
Let [0, T ] be divided using N time intervals of lenght ∆T = N .
N
X N
X
BT = BN ∆T = (Bk∆T − B(k−1)∆T ) = ∆Bk
k=1 k=1

The increments ∆Bk ∼ N (0, ∆T ) are indipendent and normally distribuited :



∆Bk = g ∆T

with g ∼ N (0, 1).

T
Start t0 = 0, B0 = 0, ∆T = N
for k = 1, . . . , N
BEGIN;
tk = tk−1 + ∆T ;
simulation of g ∼ N (0, 1);

Bk∆T = B(k−1)∆T + g ∆T ;
END;

7
Algorithm

main()
{
double k,T,brownian,B_T,time;
int N;

k=T/N;
brownian=0.;
time=0.;
for(i=1;i<=N;i++)
{
/*Time*/
time+=k;

/*Brownian path simulation*/


brownian=brownian+gaussian()*sqrt(k);
}

/* B_T */
B_T=brownian;
}

8
Brownian motion and random walk
One of the standard way used to approximate a Brownian motion is to use a random walk. Here
we use the standard symmetric random walk.
Proposition
Let (Xi , i ≥ 1) be a sequence of independent random variables such that P(Xi = ±1) = 1/2.
Set Sn = X1 + · · · + Xn .
Let ∆T = T /N be the time step. Set

BN = ∆T SN .

Then, the sequence BN converges in distribution to BT .


Consequently, if f is a bounded continuous function then
h i h i
EP f (BN ) converges to EP f (BT ) .

In the financial example 2, f (BT ) = (K − eσBT )+ . We use f (BN ) = (K − eσBN )+ , or



σ ∆T SN
g(SN ) = (K − e )+

9
Besides, E(g(SN )) can be computed as follows :

 u(N ∆T, x) = g(x),
1 1
 u(n∆T, x) = u((n + 1)∆T, x + 1) + u((n + 1)∆T, x − 1).
2 2

10
Exercise
Compute
h i
−rT
P =e EP (K − eσBT )+ .

with K = 100, r = 0.03, σ = 0.2 using


• Monte Carlo algorithm
• Tree method

11
Brownian motion with drift
Xt = µt + σBt
with Bt standard brownian motion, with µ and σ costants.

50.3

50.25

50.2

50.15

50.1

50.05

50

49.95

0 0.5 1

A french matematician Bachelier introduces it in first years of 1900 for modelling stock prices.
But there is the problem of the negative prices:

Xt ∼ N (µt, σ 2 t).

12
Geometric Brownian motion
Definition
A Geometric Brownian motion St is a continuous stochastic process such that:
P1 S0 = x.
1 2 )t+σB
P2 St = S0 e(µ− 2 σ t

Bt standard Brownian motion, µ and σ costant.

65

60

55

50

0 0.5 1

St
The log-returns log S0 have normal distribution (the returns are normal).

St 1 2
S0 is log-normal of parameters (µ − 2 σ )t and σ 2 t.

13
14
Property of the GBM

P1 Consider s<t. Then


St 1
log( ) ∼ N ((µ − σ 2 )(t − s), σ 2 (t − s))
Ss 2
Expectation

St
E( ) = eµ(t−s)
Ss
Variance

St 2µ(t−s) σ 2 (t−s)
V ar( )=e (e − 1)
Ss
P2 for each 0 ≤ t0 < t1 < . . . < tn , the relative increments Stk /Stk−1 are indipendent and
have common law.

15
Financial example 3
h i
−rT
P =e EP (K − ST )+ ,

with ST value of the GBM at time T T .


We consider a put option with underlying asset
1 2 )t+σB
St = S0 e(µ− 2 σ t

The payoff can be written


1 2 )T +σB
h(BT ) = (K − S0 e(µ− 2 σ T )+

Then
−rT h(X1 ) + · · · + h(Xn )
P ≈e
n
X1 , .., Xn ∼ N (0, T ).

16
Monte Carlo algorithm

main()
{
double mean_price,mean2_price,brownian,price,price_sample,error_price,inf_price,sup_price;
mean_price= 0.0;
mean2_price= 0.0;
for(i=1;i<=N;i++)
{

brownian=gaussian()*sqrt(T);

price_sample=MAX(0.0,K-x*exp((mu-0.5*sigma*sigma)*T+sigma*brownian));

mean_price=mean_price+price_sample;
mean2_price=mean2_price+SQR(price_sample);
}

price=exp(-r*T)*(mean_price/N);
error_price= sqrt(exp(-2.*r*T)*mean2_price/N - SQR(price))/sqrt(N-1);
inf_price= price - 1.96*(error_price);
sup_price= price + 1.96*(error_price);
}

17
Simulation of Geometric Brownian motion path
T
Let [0, T ] be divided using N time intervals of lenght ∆T = N .
N
Y N
Y
Sk∆T 1 2 )∆T +σ∆B
ST = SN ∆T = S0 = S0 e(µ− 2 σ k,

k=1
S(k−1)∆T k=1

with
1 2 1 2 √
(µ − σ )∆T + σ∆Bk = (µ − σ )∆T + σg ∆T con g ∼ N (0, 1)
2 2
Simulation of the GBM path (St )0≤t≤T :

T
Start t0 = 0, S0 = x, ∆T = N
for k = 1, . . . , N
BEGIN;
tk = tk−1 + ∆T ;
simulation of g ∼ N (0, 1); √
1 σ 2 )∆T +σg
(µ− 2 ∆T
Sk∆T = S(k−1)∆T e ;
END.

18
Algorithm

main()
{
double k,T,w_derive,s,S_N,mu=0.1,sigma=0.2,time;
int N;

k=T/N;
s=50.;
time=0.;
for(i=1;i<=N;i++)
{
/*Timew*/
time=time+k;
/*Geometric Brownian simulation*/
s=s*exp((mu-0.5*sigma*sigma)*k+sigma*gaussian()*sqrt(k));
}
/* S_T */
S_T=s;
}

19
Differential property of the Brownian motion
h i
2
E (Bt − Bs ) = t − s

Let us consider the random variable.


 2
X = Bt+∆t − Bt

Then h i
E X = (t + ∆t) − t = ∆t

and h i
2
V X = 2(∆t)

When ∆t is close to zero the r.v. X is “not to much random” and is very close to his mean ∆t:
 2
X= Bt+∆t − Bt ≈ ∆t

We write  2
dBt = dBt dBt = dt

and

dBt = dt

20
The quadratic variation of the Brownian motion in [0, T ] is equal to his variance.

Let (Bt , t ≥ 0) be a standard Brownian motion. For each T > 0 and partition
n n
0 = tn n n
0 < t1 < · · · < tn = T so that π = sup (ti − ti−1 ) goes to zero when n → ∞ :
i≤n

n 
X 2
n n
B(ti ) − B(ti−1 ) → T,
i=1

in the sense if the quadratic mean, for n → ∞

Proof
n 
hX 2 i
n n
E B(ti ) − B(ti−1 ) =T
i=1
 2
The random variables B(tn
i ) − B(tn
i−1 ) , i = 1, 2, . . . , n are indipendent.
" n # n  
X 2 X 2
Var B(tn
i ) − B(tn
i−1 ) = Var B((tn
i ) − n
B(ti−1 )
i=1 i=1
n
X 2
= 2 tn n
i − ti−1 ≤ 2πT.
i=1

This variance goes to 0 when n → ∞.

21
Stochastic integral
Consider the stochastic integral
Z T
f (t, Bt )dBt .
0

RT
We can define Xt = 0
f (t, Bt )dBt as the limit of discrete sums of the type

n−1
X n
Xn = f (tj , Btn )(Btn − Btn ),
j j+1 j
j=0

as n goes to infinity.

When can think Xn as a "Riemann sum" in which the representative point inside each
subinterval is the left-most point.

This definition of the stochastic integral is called the Ito integral.

Of course, conditions on f are necessary to ensure that Xn converge in a reasonable sense and

that the limit does not depende on the sequence on meshes tn


i .

22
Example
Z T
dBs = BT
0

Example
Z T 1 1 2
Bs dBs = − T + BT
0 2 2

23
Z T n−1
X  
Bs dBs = lim Btj · Btj+1 − Btj
0 n→∞
i=0
n−1
X 
= lim Btj Btj+1 − Bt2
n→∞ j
i=0

X
n−1
1 2 1 2 1 2

= lim − Btj+1 − Btj − Bt + Bt
n→∞
i=0
2 2 j 2 j+1
" n−1 n−1
#
1 X 2 X 2 2

= lim − Btj+1 − Btj + Bt − Bt
n→∞ 2 j+1 j
i=0 i=0
1 1 2
= − T + BT .
2 2

24
Ito integral property
Z T
f (t, Bt )dBt .
0

- Linearity
- Expectation
hZ T i
E f (t, Bt )dBt = 0.
0

- Quadratic mean
h Z T 2 i hZ T i
2
E f (t, Bt )dBt =E f (t, Bt )dt .
0 0

25
Stochastic differential equations
Definition A process (Xt )t≥0 which satisfies
Z t Z t
(1) Xt = x + µ(s, Xs )ds + σ(s, Xs )dBs ,
0 0

is called a solution of the stochastic differential equation with coefficient µ and σ, intial
condition x and Brownian motion (Bt )t≥0 .

(Xt )t≥0 is called the diffusion process corresponding to the coefficients µ and σ. We can write
the differential simbolic notation
(
dXt = µ(t, Xt )dt + σ(t, Xt )dBt
X0 = x.

Example

The standard Brownian motion, the Brownian motion with drift and the geometric Brownian

motion are solution of particular s.d.e.

26
Example : Brownian motion with drift
The Brownian motion with drift is solution of the following s.d.e.
(
dXt = µdt + σdBt
X0 = x.

It is the diffusion process corresponding to the coefficients µ(t, Xt ) = µ and σ(t, Xt ) = 1.

Stochastic Integral
Z t Z t
Xt = x + µds + σdBs
0 0

The solution is
Xt = x + µt + σBt

27
Example : Geometric Brownian motion
The Geometric Brownian motion with drift is solution of the following s.d.e.
(
dSt = µSt dt + σSt dBt
S0 = x.

Stochastic Integral
Z t Z t
(2) St = S0 + µSu du + σSu dBu
0 0

The solution is
(µ− 1 σ 2 )t+σBt
St = xe 2

The results is obtained using the Ito’s Lemma.

28
Ito’s Lemma
Lemma
Let (Xt )t≥0 the solution of

dXt = µ(t, Xt )dt + σ(t, Xt )dBt


X 0 = x0

and let f (t, Xt ) be a real-valued function of class C 1,2 .


Then

∂f (t,Xt ) ∂f (t,Xt ) 1 2 ∂ 2 f (t,Xt ) ∂f (t,Xt )


df (t, Xt ) = ( + µ(t, Xt ) + σ (t, X t ) )dt + σ(t, Xt ) dBt
∂t ∂Xt 2 ∂Xt2 ∂Xt

We can write
∂f
df (t, Xt ) = α(t, Xt )dt + dXt
∂Xt
with
∂f σ 2 (t, Xt ) ∂ 2 f
α(t, Xt ) = +
∂t 2 ∂Xt2

29
Example

dSt = µSt dt + σSt dBt


S0 = x
Using Ito’s lemma
1 2 )t+σB
St = S0 e(µ− 2 σ t

Let us consider Xt = Bt and


1 2 )t+σB
St = f (t, Bt ) = S0 e(µ− 2 σ t

Ito’s lemma implies that


 1 2 1 2 
dSt = df (t, Bt ) = (µ − σ )St + σ St dt + σSt dBt = µSt dt + σSt dBt
2 2

30
On the contrary, let is consider Xt = St and

f (t, St ) = ln(St )

Ito’s lemma implies that


1 2
dln(St ) = df (t, St ) = (µ − σ )dt + σdBt
2
or in the integral form
Z T Z T Z T
1 2
1 dln(St ) = (µ − σ ) dt + σ dBt
0 0 2 0
1
[ln(St )]T
0 = (µ − σ 2 ) [t]T T
0 + σ [Bt ]0
2
ST 1 2
ln( ) = (µ − σ )T + σ(BT − B0 )
S0 2
 
ST 1 2
= exp (µ − σ )T + σBT
S0 2

Then
 
1 2
(3) ST = S0 exp (µ − σ )T + σBT .
2

31
Example
Consider f (t, x) = x2 and Xt = Bt . Then
2
f (t, Bt ) = Bt

Ito’s lemma implies that


1 
dBt2 = df (t, Bt ) = 2 dt + 2Bt dBt = dt + 2Bt dBt
2
In the integral form
Z t Z t
2 2 1
Bt = B0 + 2du + 2Bu dBu
0 2 0

so that Z t 1 2
Bu dBu = (Bt − t).
0 2

32
Theorem (Existence and Uniqueness)
Z t Z t
(4) Xt = x + µ(s, Xs )ds + σ(s, Xs )dBs ,
0 0

If µ and σ are continuous functions, and if there exists a constant K < +∞, such that :
1. |µ(t, x) − µ(t, y)| + |σ(t, x) − σ(t, y)| ≤ K|x − y|

2. |µ(t, x)| + |σ(t, x)| ≤ K(1 + |x|)


then, for any T ≥ 0, (4) admist a unique solution in the interval [0, T ].
Moreover, this solution (Xs )0≤s≤T satisfies :
!
2
E sup |Xs | < +∞
0≤s≤T

33
Simulation diffusions paths
Euler Discretization Scheme

∆Xt = Xt+∆T − Xt = µ(t, Xt )∆t + σ(t, Xt )∆Bt


X 0 = x0

T
Start t0 = 0, x0 , ∆T = N
for k = 1, . . . , N
BEGIN;
tk = tk−1 + ∆T ;
simulation of g ∼ N (0, 1);

xk∆T = x(k−1)∆T + µ(x(k−1)∆T , tk−1 )∆T + σ(x(k−1)∆T , tk−1 )g ∆T
END;

34
Brownian motion

Definition
A Brownian motion is a real-valued, continuous stochastic process (Xt )t≥0 with indipendent,
normally distribuited and stationary increments. In other words :
• B0 = 0.
• continuity.
• indipendent increments : if s ≤ t, Bt − Bs is indipendent of Fs = σ(Bu , u ≤ s).

• stationary increments : if s ≤ t, Bt − Bs and Bt−s have the same law.

35
Continuous-time martingale

Let us consider a probability space (Ω, A, P) and a filtration F := (Ft , t ≥ 0) on this space.

Definition An adapted family (Mt , t ≥ 0) of integrable random variables is a (Ft )-martingale if


for each s ≤ t,
E (Mt |Fs ) = Ms .

It follows from the definition that if (Mt )t≥0 is a martingale, then E(Mt ) = E(M0 ), for each t.

Example

Bt is an Ft -martingale.

36
Markov property

The intuitive meaning of the Markov property is that the future behaviour of the process
(Xt )t≥0 after t depends only on the value Xt and is not influenced by the history of the process
before t.

Mathematically speaking, (Xt )t≥0 satisfies the Markov property if, for any function f bounded
and measurable and for any s and t, such that s ≤ t, we have :

E (f (Xt ) |Fs ) = E (f (Xt ) |Xs ) .

This property is satisfied for a solution of the equation (4).

This is a crucial property of the Markovian model and it will have great conseguences in the
pricing of options.

37
Black-Scholes model
- Risk-free asset (
dSt0 = rSt0 dt
S00 = 1.

- Risk asset (
dSt = µSt dt + σSt dBt
S0 = x.

with (Bt )t≥0 standard brownian motion under the historical probability P.
- The short-term interest rate is known and is costant through time.
- The stock pays no dividends or other distributions.
- There are no penalties to short-selling.
- It is possible to borrow any fraction of the price of a security to buy it or to hold it, at the
short-time interest rate.
- Absence of arbitrage opportunities.

38
Financial interpretation of the parameters
- r istantaneous interest rate : [0%, 12%]

- µ expected return of the risky asset.

St µt
E( )=e
S0

- σ is the volatility σ.
This is vey important parameters : [30%, 70%] in the equity market.
- risk premium λ
µ−r
λ=
σ
Then
µ = r + λσ

The expected return µ of the risky asset is the sum of the return of the no-risky asset plus
something proportional to σ.

39
We can write
dSt = rSt dt + σSt (dBt + λdt)
The Girsanov theorem gives
bt = dBt + λdt
dB

bt standard Brownian motion under the risk neutral probability Q.


with B

40
Dinamics under the risk neutral probability measure
(
bt
dSt = rSt dt + σSt dB
(5)
S0 = x.

bt standard Brownian motion under Q.


with B
The solution(5) is
(r− 1 σ 2 )t+σ B
b
t
St = xe 2

Then  
ST r(T −t)
EQ |Ft =e
St

41
Radon-Nikodyn Theorem
Let P and Q be two probabilty measure on (Ω, F )
If Q is absolutely continuous with respect to P, (A ∈ F , P(A) = 0 → Q(A) = 0), then there
existe a unique r.v. X ≥ 0, F -misurable such that
Z
Q(A) = XdP
A

The random variable X is commonly written as

dQ
=X
dP

X is called the Radon-Nikodyn derivative.

42
Change of probability measure in the Gaussian case
Let use consider Z ∼ N (µ, 1) under P.
Then there exists Q so that Z(0, 1) under Q where
1 2
dQ = e−µZ+ 2 µ dP.

In fact
Z Z z −(x−µ)2
1
P(Z ≤ z) = dP(ω) = √ e 2 dx,
{ω:Z(ω)≤z} −∞ 2π
and
Z Z Z
−µZ(ω)+ 1 µ2
z 1 −x2
Q(Z ≤ z) = dQ(ω) = e 2 dP(ω) = √ e 2 dx.
{ω:Z(ω)≤z} {ω:Z(ω)≤z} −∞ 2π

Moreover it holds
h i h i h i h i
µZ− 1 µ2 −µZ+ 1 µ2
EP f (Z) = EQ f (Z)e 2 and EQ f (Z) = EP f (Z)e 2 .

43
Girsanov’s Theorem
Let Bt be a Brownian motion under (Ω, F , P) adapted to the filtration Ft .
Let (Zt )0≤t≤T be the process defined by :
 1 2 
Zt = exp − λBt − λ t .
2

Then, under the probability measure Q with density ZT with respect to P

dQ = ZT dP

bt )0≤t≤T given by B
the process (B bt = Bt + λt, is a standard Brownian motion under Q.

44
Risk neutral pricing formula
 
ST r(T −t)
EQ |Ft =e
St
This holds for each asset:
hV i
T r(T −t)
EQ |Ft = e
Vt
Equivalently
 
−r(T −t)
Vt = EQ e VT |Ft .

The price of a contingent claim is the expected value of the discounted payoff.
 
−rt −rT
e Vt = EQ e VT |Ft .

Discounted prices are martingales.

45
Black-Scholes formula for European Call options
The price at time t of an European Call option in the Black-Scholes model
   
−r(T −t) −r(T −t) (r− 1 σ 2 )(T −t)+σ(BT −Bt )
Ct = EQ e CT |Ft = EQ e (St e 2 − K)+

is given by
−r(T −t)
Ct = St N (d1 ) − Ke N (d2 )
with    
St σ2
log K + r + 2 (T − t) p
d1 = √ d2 = d1 − σ T −t
σ T −t

and N (x) the distribution function of the standard Gaussian variable


Z d
1 2 /2
N (d) = √ e−x dx.
2π −∞

46
Black-Scholes formula for European Put options
The price at time t of an European put option in the Black-Scholes model
   
−r(T −t) −r(T −t) (r− 1 σ 2 )(T −t)+σ(BT −Bt )
Pt = EQ e PT |Ft = EQ e (K − St e 2 )+

is given by
−r(T −T )
Pt = Ke N (−d2 ) − St N (−d1 )

47
Implementation of the formula
The price of the call option depends on six parameters.

C = C(St = x, t, T, K, σ, r)

- The strike K and the maturity T are specified in the contract.


- r is constant. But in general this is not true (Vasicek or CIR model).

- The volatility cannot be observed directly. In practice, two methods are used to evaluate σ
– The historical method: in the BS model, σ 2 T is the variance of log(ST ) and the
variables log(S∆T /S0 ), log(S2 /S∆T ), . . . , log(SN ∆T /S(N −1)∆T ) are i.i.d random
variables.
Therefore, σ can be estimated by statistical means using past observations of the asset
price.
– the ”implied volatility” method: some options are quoted on organized markets; the
price of options being an increasing function of σ, we can associate an ”implied”
volatility to each quoted option, by inversion of the Black-Scholes formula.
Obs
C (S0 , 0, T, K) = C(S0 , 0, T, K, Σ(K, T ), r)

Σ is called implied volatility. Due to the market imperfections Σ has a typical


dependence on K called SMILE EFFECT.

48
n = m = 6, 30 iter.

0.3

0.25
0.3
0.2

0.2
0.15

0.1
0.1

0 0.05

−0.1 0

−0.2 −0.05
2
−0.1
1.5
800
1 750
700 −0.15
650
0.5 600
550 −0.2
t (an) 0 500
S

49
Approximating the distribution function of g ∼ N (0, 1)

1
Set t = 1+px , then:

1 − √1 exp(− x2 )(b1 t + b2 t2 + b3 t3 + b4 t4 + b5 t5 ) if x≥0
2π 2
N (x) = 2
 √1 exp(− x )(b1 t + b2 t2 + b3 t3 + b4 t4 + b5 t5 ) if x<0
2π 2

with the following constants :


p = 0.2316419;
b1 = 0.319381530;
b2 = −0.356563782;
b3 = 1.781477937;
b4 = −1.821255978;
b5 = 1.330274429;

50
Approximating the distribution function of g ∼ N (0, 1)

double N(double x)
{ const double p= 0.2316419;
const double b1= 0.319381530;
const double b2= -0.356563782;
const double b3= 1.781477937;
const double b4= -1.821255978;
const double b5= 1.330274429;
const double one_over_twopi= 0.39894228;
double t;
if(x >= 0.0)
{
t = 1.0 / ( 1.0 + p * x );
return (1.0 - one_over_twopi * exp( -x * x / 2.0 )
* t * ( t *( t * ( t * ( t * b5 + b4 ) + b3 ) + b2 ) + b1 ));
}
else
{/* x < 0 */
t = 1.0 / ( 1.0 - p * x );
return ( one_over_twopi * exp( -x * x / 2.0 ) *
t * ( t *( t * ( t * ( t * b5 + b4 ) + b3 ) + b2 ) + b1 ));
}
}

51
Scilab

function [y]=Norm(x)
[y,Q]=cdfnor("PQ",x,0,1);
endfunction

52
Price of a Call option

main()
{
double sigmasqrt,d1,d2,delta,price;

sigmasqrt=sigma*sqrt(t);
d1=(log(s/k)+r*t)/sigmasqrt+sigmasqrt/2.;
d2=d1-sigmasqrt;
delta=N(d1);
/*Price*/
price=s*delta-exp(-r*t)*k*N(d2);
}

53
Price of a put option

main()
{
double sigmasqrt,d1,d2,delta,price;

sigmasqrt=sigma*sqrt(t);
d1=(log(s/k)+r*t)/sigmasqrt+sigmasqrt/2.;
d2=d1-sigmasqrt;
delta=N(-d1);

/*Price*/
price=exp(-r*t)*k*N(-d2)-delta*s;
}

54
Put-Call Theorem Parity
We have the following put-call parity between the prices of the underlying asset St and
European call and put options on stocks that pay no dividends:
−r(T −t)
Ct = Pt + St − Ke .

55
Payoff Call

100

50

0 50 100 150 200

Payof Put

90

80

70

60

50

40

30

20

10

0 50 100 150 200

56
Proof of the Black-Scholes formula
h 1 2 i
−r(T −t)
C(t, x) = EQ e (xe(r− 2 σ )(T −t)+σ(BT −Bt ) − K)+

Then
h √  i
− 1 σ 2 (T −t)+σ T −tg −r(T −t)
C(t, x) = EQ xe 2 − Ke
+

with g ∼ N (0, 1).


Set  
x
 σ2
log K + r + 2 (T − t) p
d1 = √ d2 = d1 − σ T −t
σ T −t

 √  
σ (T −t)g− 1 σ 2 (T −t) −r(T −t)
C(t, x) = E xe 2 − Ke 1g≥−d2

Z  √  2
+∞
σ (T −t)y− 1 σ 2 (T −t) −r(T −t) e−y /2
= xe 2 − Ke √ dy
−d2 2π
Z  √  2
d2
−σ (T −t)y− 1 σ 2 (T −t) −r(T −t) e−y /2
= xe 2 − Ke √ dy.
−∞ 2π

57
Z  √  2
d2
−σ (T −t)y−σ 2 (T −t)/2 −r(T −t) e−y /2
C(t, x) = xe − Ke √ dy.
−∞ 2π
p
The change of variable z = y + σ (T − t), gives :

C(t, x) = xN (d1 ) − Ke−r(T −t) N (d2 ),

with : Z
1 d 2 /2
N (d) = √ e−x dx.
2π −∞

58
Monte Carlo method in the Black-Scholes model
We want compute
h i
−rT
P =e EQ (K − ST )+ .

in the Black-Scholes model

(r− 1 σ 2 )T +σBT
ST = S0 e 2

The payoff function can be written in the following way


1 2 )T +σB
h(BT ) = (K − S0 e(r− 2 σ T )+

We can approximate the price with

−rT h(X1 ) + · · · + h(Xn )


P ≈e
n
X1 , .., Xn ∼ N (0, T ).

59
Monte Carlo algorithm
European Put in the Black-Scholes model

main()
{
double mean_price,mean2_price,brownian,price,price_sample,error_price,inf_price,sup_price;
mean_price= 0.0;
mean2_price= 0.0;
for(i=1;i<=N;i++)
{

brownian=gaussian()*sqrt(T);

price_sample=MAX(0.0,K-x*exp((r-0.5*sigma*sigma)*T+sigma*brownian));

mean_price= mean_price+price_sample;
mean2_price= mean2_price+SQR(price_sample);
}
/* Price */
price=exp(-r*T)*(mean_price/N);
error_price= sqrt(exp(-2.*r*T)*mean2_price/N - SQR(price))/sqrt(N-1);
inf_price= price - 1.96*(error_price);
sup_price= price + 1.96*(error_price);
}

60

You might also like