Professional Documents
Culture Documents
Implicit methods
07.01.2019
Table of Content
1 Basic concepts
3 Bibliography
Basic concepts
Option
It’s a contract which gives to its owner, called holder or buyer,
the right to buy or to sell at a fixed price, called strike or exercise
price, a specified underlying asset, like a stock, an index, or a
foreign currency, any time before or just on a specific date, called
expiry or maturity date. There are many different types:
CALL or PUT if they allow you to buy or to sell, respectively.
Exotic or vanilla if the final pay-off depends on the history of the
asset or not, respectively .
American or European if it is allowed to exercise the option before
the expiry date or not, respectively.
Basic concepts
Cont.
Π = ∆S − f (S, t) (1)
We want to estimate the rate of change of the portfolio, so let’s
compute dΠ:
dΠ = ∆dS − df (2)
If the asset follows a lognormal or geometric brownian motion then
we know that dS = µSdt + σSdW , where µ is the drift of the
motion and σ is the volatility, so by Itô’s lemma we have:
1 2 2 ∂2f
∂f ∂f
dΠ = ∆ − dS − + σ S dt (3)
∂S ∂t 2 ∂S 2
Basic concepts
Cont.
∂f
∆= (4)
∂S
This is called hedging. So we are left with:
1 2 2 ∂2f
∂f
dΠ = − + σ S dt (5)
∂t 2 ∂S 2
Now, since the portfolio is now riskless, this investment must be
equivalent to putting that money on a risk-less bank account
(no-arbitrage principle)
dΠ = Πrdt (6)
Where r is the risk-less interest rate.
Basic concepts
Cont.
Now we can substitute finally Eq. 1, Eq. 4 and Eq. 5 here and get
the famous Black-Scholes equation:
∂f ∂f 1 ∂2f
+ rS + σ 2 S 2 2 = rf (Black-Scholes equation)
∂t ∂S 2 ∂S
(7)
Basic concepts
Cont.
d 2f
1 fi+1 − fi fi − fi−1 fi+1 − 2fi + fi−1
2
(x0 = xi ) ≈ − =
dx δx δx δx δx 2
(11)
Pricing of a Vanilla European Option by implicit methods
Mathematical formulation of the problem
∂f ∂f 1 ∂2f
+ rS + σ 2 S 2 2 = rf (Black-Scholes equation)
∂t ∂S 2 ∂S
(12)
Pricing of a Vanilla European Option by implicit methods
Mathematical formulation of the problem
∂f ∂f 1 2 2 ∂ 2 f
+rS + σ S = rf (Black-Scholes equation)
∂t ∂S 2 ∂S 2
f (S, T ) = (S−K )+ = max(S−K , 0) (Terminal condition)
−r (T −t)
f (0, t) = 0, f (Smax , t) = Smax −Ke (Boundary conditions)
Put option
∂f ∂f 1 2 2 ∂ 2 f
+rS + σ S = rf (Black-Scholes equation)
∂t ∂S 2 ∂S 2
f (S, T ) = (K −S)+ = max(K −S, 0) (Terminal condition)
f (0, t) = Ke −r (T −t) , f (Smax , t) = 0 (Boundary conditions)
Pricing of a Vanilla European Option by implicit methods
Numerical setup
Numerical setup
First of all, we need to discretize the domain, so we construct a
grid whose nodes are coordinates formed by the Cartesian product
of the sequences:
MATLAB implementation
Following the previously described strategy. We implement this
method to replicated the example shown by Wilcott in his section
28.12: The Code#1: European option on [2]. In his example
Wilcott tries to compute the price of an option with the following
features for different times.
1 t =0: d t : T ;
2 S=0: dS : Smax ;
3
4 %T e r m i n a l c o n d i t i o n and b o u n d a r y c o n d i t i o n s
5 F=z e r o s (M+1 ,N+1) ;
6 i f t y p==’C ’
7 f o r i =1: l e n g t h ( S )
8 F ( i , N+1)=max ( [ S ( i )−K , 0 ] ) ;
9 end
10 f o r j =1: l e n g t h ( t )
11 F ( 1 , j ) =0;
12 F (M+1 , j )=Smax−K∗ exp (− r ∗ (T−t ( j ) ) ) ;
13 end
14 e l s e i f t y p==’P ’
15 f o r i =1: l e n g t h ( S )
16 F ( i , N+1)=max ( [ K−S ( i ) , 0 ] ) ;
17 end
18
Pricing of a Vanilla European Option by implicit methods
Matlab implementation
1 f o r j =1: l e n g t h ( t )
2 F ( 1 , j )=K∗ exp (− r ∗ (T−t ( j ) ) ) ;
3 F (M+1 , j ) =0;
4 end
5 else
6 s p r i n t f ( ’ P l e a s e choose a v a l i d type between C f o r
c a l l s and P f o r p u t s ’ )
7 return
8 end
9
10 %C o n s t r u c t i o n o f m a t r i x A
11 a =0.5∗ r ∗ d t /dS∗S ( 2 :M) −.5∗( s i g m a ˆ 2 ) ∗ d t / ( dS ˆ 2 ) ∗ ( S ( 2 :M) . ˆ 2 )
;
12 b=1+r ∗ d t +( s i g m a ˆ 2 ) ∗ d t / ( dS ˆ 2 ) ∗ ( S ( 2 :M) . ˆ 2 ) ;
13 c =−.5∗ r ∗ d t /dS∗S ( 2 :M) −.5∗( s i g m a ˆ 2 ) ∗ d t / ( dS ˆ 2 ) ∗ ( S ( 2 :M) . ˆ 2 )
;
14 A=d i a g ( b )+d i a g ( a ( 2 :M−1) , −1)+d i a g ( c ( 1 :M−2) , 1 ) ;
15
16 %S o l u t i o n o f t h e s y s t e m
Pricing of a Vanilla European Option by implicit methods
Matlab implementation
1 %S o l u t i o n o f t h e s y s t e m
2 f o r j=N: −1:1
3 b=[ a ( 1 ) ∗F ( 1 , j ) ; z e r o s (M−3 ,1) ; c (M−1)∗F (M+1 , j ) ] ;
4 F ( ( 2 :M) , j )=A\ ( F ( ( 2 :M) , j +1)−b ) ;
5 end
6
Pricing of a Vanilla European Option by implicit methods
Results
Using the previous code we found the value of the option given the
price of the underlying asset at different times. Below the
distribution of the option value for different asset price and
different times is shown: