Tesi Pdfa
Tesi Pdfa
SCHOOL OF ENGINEERING
FACULTY OF MATHEMATICAL ENGINEERING
Master Degree in Financial Engineering
Master Thesis
i
ii
Contents
3 Program implementation 49
3.1 Enum Classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
3.2 Option Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
3.3 Dynamics Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
3.4 Discretizer Class . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.5 Builder class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
4 Numerical Results 63
4.1 European Options in 1 Dimension . . . . . . . . . . . . . . . . . 63
4.2 Barrier Options in 1 dimension . . . . . . . . . . . . . . . . . . . 77
4.3 Asian Options in 1 Dimension . . . . . . . . . . . . . . . . . . . . 78
4.4 Basket Options in 2 Dimensions . . . . . . . . . . . . . . . . . . . 84
Bibliography 87
1
2 CONTENTS
Introduction
In this introductory section, we will summarize the main concepts that under-
pin the subsequent chapters, aiming to present the problem, explore how it can
be approached, and demonstrate its resolution using the associated partial dif-
ferential equations (PDEs) for specic types of options. To ensure this work
is self-contained, we will establish notation rules that will assist the reader in
understanding how the dierent chapters interconnect.
The rst section introduces the Black-Scholes framework and the derivation
of the Feynman-Ka£ PDE for European options. Additionally, we will discuss
the PDEs relevant to other types of options, such as Barrier Options, Asian
Options, and American Options.
The second chapter focuses on a review of the most commonly used numerical
methods for solving PDEs: the nite dierence method and the nite element
method (FEM). While these topics are broad, we will narrow our focus to the
specic aspects that are essential for the applications discussed later in this
work.
These chapters are not intended to introduce new concepts to the expert
reader but rather to provide a focused overview of the necessary background.
This will ensure that all the required results are clearly stated and contextu-
alized within the scope of this thesis. We encourage all readers to go through
these introductory sections to grasp the overarching ideas that have guided this
project.
In preparing the rst two chapters, we have relied heavily on two semi-
nal works in the eld. For the introduction to the Black-Scholes model, we
have drawn primarily from Bj"ork's "Arbitrage Theory in Continuous Time"
[5]. For the formalism of numerical methods, we have referred to Achdou and
Pironneau's "Computational Methods for Option Pricing" [2]. In the course of
the discussion, we will omit certain technical details and proofs that are beyond
the scope of this work; these can be found in the aforementioned texts or other
cited sources.
3
4 CONTENTS
Chapter 1
where the volatility σ and the drift term µ are constants, and Wt is a
standard Brownian motion.
5
6 CHAPTER 1. BLACK-SCHOLES MODEL: A BRIEF RECAP
rate (if it exists) is almost never constant. These two aspects are not signicant
limitations because a similar discussion can be developed even with non-constant
volatility and interest rates. On the other hand, the market eciency and
absence of friction hypotheses are also not generally true, and other papers
attempt to discuss these scenarios.
Observation 1.2. Supposing that the asset follows the geometric Brownian
motion law 1.1, it is possible to dene the Stochastic Dierential Equation
(SDE):
(
dSt = µSt dt + σSt dWt
(1.2)
S0 = s0
This can be rewritten as
dSt
= µ dt + σ dWt
St
implying that the real assumption of the Black-Scholes model is that the returns
of St follow an Arithmetic Brownian motion with drift µ and diusion σ.
dBt = r dt
t
Bt ,
B0 = 1
Proposition 1.4. The SDE related to the Geometric Brownian motion 1.2 has
a closed-form solution:
1 2
St = s0 eµt+σWt − 2 σ t . (1.3)
E [St ] = s0 eµt .
Thus, we have:
dX = µ − 1 σ 2 dt + σdW
t
2
X0 = ln s0
This equation is extremely simple: on the right-hand side, it does not contain
X, and therefore, it can be integrated directly to:
1
Xt = ln s0 + µ − σ 2 t + σWt
2
Returning to St , we have:
1 2
St = s0 e(µ− 2 σ )t+σWt
.
We have now derived the two dynamics fundamental to dene the Black-
Scholes Model: the risk-free asset Bt and the risky one St :
(
dBt = rBt dt
(1.4)
dSt = µSt dt + σSt dWt
From Proposition 1.4, it is clear that the discounted risky asset e−r(T −t) St
cannot be a martingale unless µ = r, which is generally not true. Moreover, the
value of µ is typically unknown, and dierent market agents may have dierent
opinions on its value. Indeed, the value of µ is subjective, as is the probability
density P used to compute the expected value E. With this consideration in
mind, it is clear that, if we want results acceptable to all market agents, we need
to change the probability density to the so-called risk-neutral probability
Q: a new probability density depending only on the market and not on agents'
opinions, where the probability of upward and downward movements is no longer
subjective but objective.
Under Q, all discounted risky assets behave as martingales, meaning that the
drift of each asset is equal to the risk-free rate used for discounting. To achieve
this density, it is sucient to dene the stochastic process W̃t = Wt + µ−r
σ t and
the Radon-Nikodym density
(Z 2 )
t Z t
dQ r−µ 1 r−µ
= exp dWs − ds .
dP Ft 0 σ 2 0 σ
In this new probability space, the Black-Scholes model initially stated under P
in 1.4 is equivalent under Q to
(
dBt = rBt dt
dSt = rSt dt + σSt dW̃t
Our aim in this paper is to price some claims using the Black-Scholes model
stated above. We will use the notation Π(t, X) for the price process of the
claim X, but sometimes we will also use the notation Π(t, Φ) to underline the
dependency of the price on the payo. We will also use F (t, St = s, T, Φ) to
denote the price function of a contingent claim. Later on, we will nd claims
with dierent dependencies, like Asian Options, but for this initial discussion,
this assumption is sucient for our purposes and does not lead to a loss of
generality.
To provide a fair price for a contingent claim, a classical approach is to
consider a replicating portfolio, which is a portfolio able to achieve almost
surely (in the measure-theoretic sense, not in the common language sense!) the
contingent claim payo. We will prove that, in the case of anecient market
with absence of arbitrage opportunities, the value of this portfolio must be
equal to the price of the contingent claim. To achieve this conclusion, we need
the following denitions.
i.e., it is a portfolio where the only variations are due to the variation of the
asset's value.
For example, we can build a self-nancing portfolio using the two assets
Bt and St with the vector weight ωt = (αt , βt ). We can dene the vector
S̃t = (St , Bt ) and the value of our portfolio as
Vt = ωt S̃t = αt St + βt Bt .
V0ω = 0
P (VTω ≥ 0) = 1
P (VTω > 0) > 0.
This observation is also quite intuitive using the classical absence of arbitrage
opportunity argument: since we can compose one payo as the sum of two
simpler payos, the sum of the prices of each term must be equal to the price
of the original payo to avoid arbitrage opportunities.
Returning to the process Π(t, X), we assume that the process can be ex-
pressed as a smooth price function F of (t, S(t)):
then we look for a function F such that the absence of arbitrage opportunities
is preserved. With these assumptions, it was proven in the Black-Scholes paper
[12] that the key idea is to impose the existence of a replicating portfolio for the
contingent claim payo, and that the value of the portfolio V ωt and the price
Π(t) must have the same dynamics at each time instant. This is equivalent to
saying
dV ωt = dΠ(t) = dF (t, St ),
∂ 2 F (t, s)
∂F (t, s) ∂F (t, s) 1 2 2
+ rs + s σ (t, s) − rF (t, s) = 0
∂t ∂s 2 ∂s2 (1.5)
F (T, s) = Φ(s) for all s ∈ (0, +∞)
Clearly, this result is powerful but not without weaknesses. Firstly, we as-
sumed that the price of the contingent claim is a function depending only on
(t, St ), which implies that we supposed a Markovian property of the price. This
assumption is generally not convincing, as market agents usually tend to price
every instrument also by looking at its historical prices. Another objection is to
the hypothesis that there exists a market where the underlying asset is traded;
indeed, we assumed that we could replicate the contingent claim with a portfolio
on the asset itself, which we can only build if we have access to a market where
the stock is traded. However, it is possible to provide an alternative argument
for equation 1.5 that is not open to the previous criticism. The surprising fact
is that the pricing equation does not contain the local mean rate of return µ
of the underlying asset. This means that, when it comes to pricing derivatives,
the local rate of return of the underlying asset plays no role whatsoever. The
only aspect of the underlying price process that is of any importance is the
volatility σ(t, s). Thus, for a given volatility, the price of a xed derivative (like
a European Call Option) will be exactly the same regardless of the underlying
stock's return.
This alternative procedure uses a Risk-Neutral Valuation technique and
a Martingale approach: it starts from the stochastic representation formula 1.4
and proves that the Black-Scholes model is arbitrage-free if and only if there
exists a local martingale measure where both the assets are local martingales.
Returning to equation 1.5, it is possible to compute the function F using
the Feynman-Ka£ stochastic representation formula.
Observation 1.11. The Black-Scholes PDE 1.5 can also be stated for: a free-
risk interest rate function r(t), a volatility function σ(t, s), and dividend-paying
assets where the dividend is innitesimal and paid at any time instant. In this
case, the dividend in dt is q(t)St dt, and the PDE becomes
∂ 2 F (t, s)
∂F (t, s) ∂F (t, s) 1 2 2
+ (r − q(t))s + s σ (t, s) − rF (t, s) = 0
∂t ∂s 2 ∂s2 (1.6)
F (T, s) = Φ(s) for all s ∈ (0, +∞)
This PDE has the same structure as the classical Black-Scholes PDE if we
dene r̃ = r − q(t), so, without loss of generality, we will not consider dividend-
paying assets in the following discussion.
∂ 2 F (t, x)
∂F (t, x) ∂F (t, x) 1 2
+ µ(t, x) + σ (t, x) − rF (t, x) = 0
∂t ∂x 2 ∂x2 (1.7)
F (T, x) = Φ(x) for all x ∈ (0, +∞)
which has the same dynamics as the process S but with a dierent drift term r
instead of µ.
An important consequence of the representation formula 1.8 for F is that it is
possible to compute an analytical fair price for a simple contingent claim when r
and σ are constants and the function Φ(ST ) is simple enough to be integrated.
Indeed, recalling the dynamics of the BS model 1.4 under the probability Q,
which we report here:
(
dBt = rBt dt
(1.9)
dSt = rSt dt + σSt dWt
and recalling the solution 1.3 of the geometric Brownian motion with initial
condition St = s 2
1
)(T −t)+σ(WT −Wt )
ST = s e(r− 2 σ ,
we have the pricing function
Z ∞
−r(T −t)
F (t, s) = e Φ(sez )f (z) dz,
−∞
√
1
N r − σ 2 (T − t), σ T − t .
2
12 CHAPTER 1. BLACK-SCHOLES MODEL: A BRIEF RECAP
In general, the integral of the function Φ is not computable and must be eval-
uated numerically, but in a few particular cases, the solution can be computed
analytically. Two known examples where this is possible are for the European
Call and Put Options, where the payo function is respectively Φ(x) = (x−K)+
+
and Φ(x) = (K − x) .
Example 1.14 (Black-Scholes formula for European Call and Put Option ). For
the European Call Option, we know that Φ(x) = (x − K)+ , then
Z ∞
+
EQ
t,s [(ST − K) ] = (ST − K)+ f (z) dz
−∞
Z ∞
1 2
)(T −t)+σ(WT −Wt )
= (se(r− 2 σ − K)+ f (z) dz
−∞
Z ∞ √
1 2
)(T −t)+σ T −tz
= (se(r− 2 σ − K)f (z) dz
ln( K
s )
which is an integral easy to compute, using the linearity of the integral operator
and completing the square in the exponent, so that we obtain two cumulative
distribution functions N of the standard normal distribution N (0, 1). At the
end, we achieve the famous Black-Scholes formula:
with
s
ln( K ) + (r + 12 σ 2 )(T − t)
d1 (t, s) = √
σ T −t
√
d2 (t, s) = d1 (t, s) − σ T − t.
A similar computation can be made for the European Put Option, whose
payo function is Φ(x) = (K − x)+ , obtaining:
Z ∞
+
EQ
t,s [(K − ST ) ] = (K − ST )+ f (z) dz
−∞
Z ∞
1 2
)(T −t)+σ(WT −Wt ) +
= (K − se(r− 2 σ ) f (z) dz
−∞
Z ln( K
s ) √
1 2
)(T −t)+σ T −tz
= (K − se(r− 2 σ )f (z) dz
−∞
Another famous type of Options is the so-called European Digital (or binary)
Options. These Options can be Call Options or Put Options, and they grant
the owner the right to earn 1 if the underlying is in a specic region and 0
otherwise. For the Call Option, the owner has the right to get a payo of 1 if
the underlying is above a given strike K at maturity T and 0 if the underlying
1.1. SINGLE ASSET PROCESS 13
is below it (resp. 0 and 1 for the Put Option with the same parameters). Then
we have that these payos can be expressed as
(
1 ST > K
ΦDigital Call (ST ) = 1ST >K =
0 otherwise
(
0 ST > K
ΦDigital Put (ST ) = 1ST ≤K =
1 otherwise
An easy observation of these Options is that a portfolio made by a European
Digital Call and a European Digital Put with the same strike K and maturity
T will almost surely get a payo of 1 at maturity because
Example 1.15 (Black-Scholes formula for European Call and Put Digital Op-
tion ). For these Options, we can derive a closed pricing formula using the for-
mula for European Call and Put Options that we just derived. For a European
Call payo, we have
which means that the Call payo can be expressed in terms of two dierent
terms, one of which is a digital Option multiplied by K. Since during the
computation of the Call price the two terms were computed separately, we can
conclude from this observation that the price of the European Digital Call is
just the second term with K = 1. It means its price is
FDigital Put (t, s) = e−r(T −t) − FDigital Call (t, s) = e−r(T −t) (1 − N [d2 (t, s)]) .
Clearly, the Black-Scholes PDE 1.5 has been studied in detail with extensive
literature, and the results we reported here are just a few that are useful to
introduce the problem and to give key information about this theory. Several
other formulas have been proved for other payos or for compositions of these
simple Options.
To conclude, we report here a general theorem with some sucient condi-
tions to ensure the existence and uniqueness of a strong solution for the pricing
problem [14] (a strong solution is a solution in the classical sense).
Theorem 1.16 (∃! strong solution [14]). There exists a unique strong solu-
tion F ∈ C 0 (R+ ×[0, T ]) for the Black-Scholes PDE 1.5 if the following condi-
tions are respected:
14 CHAPTER 1. BLACK-SCHOLES MODEL: A BRIEF RECAP
Now that we have seen how it is possible, with the Black-Scholes assump-
tions, to solve the option pricing problem by solving a PDE numerically (in
general), we would like to investigate further the connection between SDEs and
PDEs. In particular, we want to focus our attention on the Innitesimal Op-
erator, which is a partial dierential operator closely connected with the Ito
formula and is useful for our purpose because it is known for its property of
connecting the probabilistic properties of a process with a specic PDE.
(Alternative names for this operator are Dynkin operator, Ito operator, or
Kolmogorov backward operator.)
Consider now a 1-dimensional SDE:
(
dXs = µ(s, Xs )ds + σ(s, Xs )dWs
Xt = x
∂ 1 ∂2
A = µ(t, x) + σ 2 (t, x) 2 .
∂x 2 ∂x
If we consider the boundary value problem dened by the following PDE and
initial condition F (T, x) = Φ(x):
∂F
(t, x) + AF (t, x) = 0,
∂t
1.2. MULTI-ASSET PROCESSES 15
∂F ∂F 1 ∂2F
(t, x) + µ(t, x) (t, x) + σ 2 (t, x) 2 (t, x) = 0,
∂t ∂x 2 ∂x
and we apply Ito's lemma to the process F (s, X(s)), we obtain:
Z T
∂F
F (T, XT ) = F (t, Xt ) + (s, Xs ) + AF (s, Xs ) ds
t ∂t
Z T
∂F
+ σ(s, Xs ) (s, Xs ) dWs .
t ∂x
The time integral vanishes due to our denition of the PDE, and the stochas-
tic integral will also vanish if σ(s, Xs ) ∂F
∂x (s, Xs ) is suciently integrable, and
we take the expected value. Applying the boundary condition F (T, x) = Φ(x)
and the initial value Xt = x, we conclude that
!
σ1
dS1t = S1t µ1 + p (dW1t + ρdW2t )
1 + ρ2
! (1.10)
σ2
dS2t = S2t µ2 + p (ρdW1t + dW2t )
1 + ρ2
2 2
∂F − 1
X ∂2F X ∂F
Mk,l Sk Sl − rSk + rF = 0, t ∈ (0, T ], S1,2 > 0
∂t 2 ∂Sk ∂Sl ∂Sk
k,l=1 k=1
F (0, S1 , S2 ) = Φ(S1 , S2 ), S1 , S2 > 0
(1.11)
where the matrix M,
" #
2ρ
σ2 1+ρ2 σ1 σ2
M = 2ρ 1
1+ρ2 σ1 σ2 σ22
+
Φ0 (S1 , S2 ) = (K − (S1 + S2 )) (1.12)
+
Φ0 (S1 , S2 ) = (K − max(S1 , S2 )) (1.13)
+
Φ0 (S1 , S2 ) = (K − min(S1 , S2 )) (1.14)
2
We can notice here that the rst two payos belong to L , the space of square
integrable functions, while the third does not. Indeed, this last payo function
is constantly equal to K on the whole lines x = 0, y = 0. As a consequence of
this, the theory of weak solutions that we will study later cannot be applied to
this function, while it holds true for the rst two payos.
For the Call options, we can mention the payo functions:
+
Φ0 (S1 , S2 ) = ((S1 + S2 ) − K) (1.15)
+
Φ0 (S1 , S2 ) = (max(S1 , S2 ) − K) (1.16)
+
Φ0 (S1 , S2 ) = (min(S1 , S2 ) − K) (1.17)
2
which are clearly not in L since they are all unbounded, for example, on the
line S1 = S2 .
It will be useful later to consider the behavior of the payos in the degenerate
cases S1 = 0 or S2 = 0. It is easy to notice that some payos become the one-
dimensional usual Call/Put, while others become constant 0 or K.
A Barrier Call (resp. Put) Option is a contract that gives its owner the right
to buy (resp. sell) a share of a specic stock at a xed price K at maturity T
if a barrier event has not occurred. Several types of barrier events exist in
the nancial markets, the most famous being the Up-and-Out with barrier B
(resp. the Down-and-Out with barrier b), where the barrier event occurs if the
underlying price Si reaches the high value B at any point during the Option's
life (resp. if Si reaches the low value b). Another type of barrier includes the
1.3. OTHER OPTIONS: BARRIER, LOOKBACK, ASIAN, AND AMERICAN OPTIONS17
Up-and-In with barrier B (resp. the Down-and-In with barrier b), where the
barrier event occurs if the underlying price Si does not reach the high value B at
any point during the Option's life (resp. if Si reaches the low value b). Barrier
Options of the rst type are also called Knock-Out Options, while those of the
second type are called Knock-In Options.
Observation 1.18 (In-Out Parity). It is easy to see that the sum of the
payos of an Up-and-Out and an Up-and-In Barrier Option with the same
barrier B on the same initial contingent claim Z will equal the payo of Z.
Therefore, the sum of the prices of these two Barrier Options must equal the
price of the initial contingent claim, in the absence of arbitrage opportunities. A
similar observation holds true for the Down-and-Out and Down-and-In Barrier
Options.
To illustrate, consider the Barrier Options on the stock plot in Figure 1.1.
In this case, an Up-and-Out Barrier Call Option with a barrier at B and strike
K = S0 would not pay out, while a similar Up-and-In Barrier Call Option
would. On the other hand, a Down-and-Out Option with a barrier at b would
pay out, while a Down-and-In Option would not.
To study these kinds of Options, some denitions are necessary, and we will
use the standard results proposed by Borodin-Salminen [6]. Let {X(t); 0 ≤ t ≤
∞} be a generic process with continuous trajectories taking values in R.
Denition 1.19 (Hitting Time ). For any y ∈ R, the hitting time of y , τ (X, y),
also denoted by τ (y) or τy , is dened by
Xy (t) = X(t ∧ τ ),
We can also dene ΦB as the chopped version of the payo Φ above the
barrier B: (
Φ(x) for x<B
ΦB (x) (1.19)
0 for x≥B
With this notation, we can rephrase the In-Out Parity in Observation 1.18
as:
2r̃2 2
b σ b
FbO (t, s, Φ) = F (t, s, Φb ) − F t, , Φb
s s
2r̃2
B2 B
BO B B σ
F (t, s, Φ) = F (t, s, Φ ) − F t, ,Φ
s s
(1.21)
2r̃2 2
b b σ b
FbI (t, s, Φ) = F (t, s, Φ ) + F t, , Φb
s s
2r̃2
B2 B
BI B σ
F (t, s, Φ) = F (t, s, ΦB ) + F t, ,Φ ,
s s
where we used:
1
r̃ = r − σ 2 .
2
Using this theorem, we can also prove that the linearity of F on the payo
implies the linearity of the pricing function for the Barrier Option. In formula,
we have:
FbO (t, s, aΦ + bΨ) = aFbO (t, s, Φ) + bFbO (t, s, Ψ),
which holds true also for the other pricing functions for Barrier Options.
Before considering some examples for (1.21), we recall the payo and the
prices for some basic payos like the stock ST , the zero-coupon BO, the digital
Call H, the Call C, and the Put P. We have that (in bold are the pricing
functions):
ST (x) = x
ST (t, s) = s
BO(t, s) = e−r(T −t)
BO(x) = 1
"
s
#
1, x > L
−r(T −t) r̃(T − t) + log L
H(x, L) = H(t, s, L) = e N √
0, x ≤ L
σ T −t
C(x, K) = (x − K)+
C(x, K) = c(t, s, K)
P (x, K) = (K − x)+
P (x, K) = p(t, s, K)
(1.22)
where c(t, s, K) and p(t, s, K) are the usual Black-Scholes formulas.
2r̃2 2
b σ b
BObO (t, s) = H(t, s, b) − H t, , b .
s s
20 CHAPTER 1. BLACK-SCHOLES MODEL: A BRIEF RECAP
2r̃2 2 !
b σ b
STbO (t, s) = b H(t, s, b) − H t, , b
s s
2r̃2 2
b σ b
+ C(t, s, b) − C t, , b .
s s
For L < K:
2r̃2 2
b σ b
CbO (t, s, K) = C(t, s, K) − C t, , K .
s s
For L > K:
PbO (t, s, K) = KBObO (t, s) − STbO (t, s) + CbO (t, s, K). (1.23)
Now that we have these key results that we can use to price both a Down-
and-Out Call and a Down-and-Out Put, we would like to derive the analogous
results for the Up-and-Out contracts. It is not surprising that these results can
be obtained by following the same ideas, reversing the role of some instruments
during the discussion. For example, if we consider the digital Put Option with
payo:
(
0, x>L
H̃(x, L) = ,
1, x≤L
with pricing function:
" #
S0
ln + r̃(T − t)
H̃(t, s, L) = e−r(T −t) N K
√ ,
σ T −t
2r̃2
B2
B σ
BO BO (t, s) = H̃(t, s, B) − H̃ t, ,B .
s s
1.3. OTHER OPTIONS: BARRIER, LOOKBACK, ASIAN, AND AMERICAN OPTIONS21
2r̃ !
B2
B σ2
STBO (t, s) = B H̃(t, s, B) − H̃ t, ,B
s s
2r̃2
B2
B σ
− P (t, s, B) + P t, ,B .
s s
Proposition 1.30 (Up-and-Out Put). The Up-and-Out European Put Op-
tion is priced as:
To conclude this discussion, we just need the Put-Call Parity for this Option,
which is given by:
This last result concludes the discussion on Out contracts, at least for Call
and Put Options.
Turning our attention to the In contracts, we can achieve similar pricing
formulas simply by applying the In-Out Parity of Observation 1.18 and Formula
1.20.
If L < K:
2r̃2 2
b σ b
CbI (t, s, K) = C t, , K .
s s
If L > K:
2r̃2 2 2
b σ b b
CbI (t, s, K) = C t, , K + (b − K)H t, , b
s s s
− (b − K)H(t, s, b).
22 CHAPTER 1. BLACK-SCHOLES MODEL: A BRIEF RECAP
Now let's consider an Option with two Out barriers ( double knockout Option )
b, B (the cases b=0 and B=∞ St . To
can be treated similarly) on the asset
derive a PDE, we consider the stopping time τ = inf{t ∈ [0, T ] : St ∈
/ (b, B)},
which represents the rst exit moment for St from the interval (b, B); after this
moment, it is certain that the Option will pay 0 because the barrier event has
occurred.
Instead of St , we will consider the absorbed process St∧τ , which is also a
Markov process, and its discounted version e−r(T −t∧τ ) St∧τ is a martingale. It
is easy to notice that the price of this Option will be a function of t ∧ τ and of
the absorbed process. We have that its pricing function will be:
(
F (t ∧ τ, St∧τ ) Ω = on [0, T ] × (b, B)
F (t ∧ τ, St∧τ ) = .
0 otherwise
∂F ∂F σ2 S 2 ∂ 2 F
+ rS + =0 on Ω = [0, T ] × (b, B)
∂t ∂S 2 ∂S 2
F (T, S) = Φ(S) nal condition
. (1.25)
F (t, b) = F (t, B) = 0 boundary condition
We focus here on the Lookback Put, but it is possible to derive closed for-
mulas for pricing the other three options as well. Other standard results can
be found in Conze and Viswanathan (1991) [11] and Goldman et al. (1979)
[16]. As with Barrier Options, these results can be proven using the running
maximum and running minimum processes, which have a known distribution.
1.3. OTHER OPTIONS: BARRIER, LOOKBACK, ASIAN, AND AMERICAN OPTIONS23
Proposition 1.33 (Lookback Put Price). The price of the Lookback Put at
t=0 is given by:
h √ i σ2 σ2 h √ i
F (s, 0) = −sN [−d]+se−rT N −d + σ T +s N [d]−se−rT N −d + σ T ,
2r 2r
where:
rT + 12 σ 2 T
d= √ ,
σ T
and N is the Normal distribution.
σ2 S 2 ∂ 2 F
∂F ∂F
+ + rS − rF = 0,
2 ∂S 2
∂t
∂S
F (T, S, M ) = Φ(S, M ), .
∂F
(t, S, S) = 0.
∂M
This three-dimensional problem (one dimension in time and two in space) can
be reduced to a two-dimensional problem (one in time and one in space) if the
payo is of the form Φ(S, M ) = M Φ̃(S/M ) (as in the Lookback Put). Indeed,
if we consider the change of variables F (t, S, M ) = M ω(t, S/M ), where ω(t, ξ)
is a function on the new domain Ω̃ = {(t, ξ) : t ∈ [0, T ], ξ ∈ [0, 1]}, it satises:
2 2 2
∂ω + σ ξ ∂ ω + rξ ∂ω + rω = 0,
2 ∂ξ 2
∂t ∂ξ
ω(T, ξ) = Φ̃(ξ), . (1.26)
∂ω
(t, 1) = ω(t, 1).
∂ξ
σ2 S 2 ∂ 2 F
∂F ∂F
+ + rS − rF = 0,
2 ∂S 2
∂t
∂S
F (T, S, m) = Φ(S, m), .
∂F
(t, S, S) = 0.
∂m
We can apply a similar change of variables F (t, S, m) = mω(t, S/m) when
Φ(S, m) = mΦ̃(S/m), with ω(t, ξ) a function on the new domain Ω̃ = {(t, ξ) :
24 CHAPTER 1. BLACK-SCHOLES MODEL: A BRIEF RECAP
A European Asian Option is a contract with maturity T that allows the owner
to earn a payo based on the average price of the risky asset over a specied
period. The payo can be written as Φ(ST , AT ), where AT is an average of St .
There are dierent types of averages commonly used in the market:
Discrete Monitoring : This is the most commonly used method, where the
monitoring occurs at the times 0 = t0 , t1 , . . . , tn = T :
n
1X
A(0, T ) = S(ti );
n i=0
Integral Average : We will use this for our purposes as it is the continuous
counterpart of discrete monitoring:
T
1
Z
A(0, T ) = Sr dr;
T 0
Geometric Average :
n
! n1
Y
A(0, T ) = S(ti ) ,
i=0
!
T
1
Z
A(0, T ) = exp ln(S(t)) dt ;
T 0
The most famous examples of Asian Options belong to two families: xed
strike and oating strike. For example:
σ2 S 2 ∂ 2 F
∂F ∂F 1 ∂F
+ 2
+ rS + (S − A) − rF = 0,
∂t 2 ∂S ∂S t ∂A (1.28)
F (T, S, A) = Φ(S, A).
where Φ̃(ξ) = (ξ − K)+ . The same result holds true for a oating strike Put
+ +
with Φ(S, A) = (K − A) using the same change of variables and Φ̃(ξ) = (ξ) .
+
If we focus our attention on the oating strike Call with Φ(S, A) = (S − A)
+
(and similarly for the oating strike Put Φ(S, A) = (A − S) ), using the change
tA + −
of variable F (t, S, A) = Sω(t, −
T s ) and Φ̃(ξ) = (1+ξ) (resp. Φ̃(ξ) = (1+ξ) ),
we obtain the same PDE 1.29. However, it is important to note that these
reductions are not possible for general interest rates and volatilities that depend
on (t, S, A).
As mentioned earlier, for geometric average Asian Options, it is possible to
derive closed-form formulas since we know the distribution of the average. In
Kemna and Vorst (1990) [23], more formulas are provided in detail. Here, we
present one example:
σ 2 (n + 1)(2n + 1)
σn2 = ,
6n2
ln SK0 + µn + 12 σn2 T
dn = √ .
σn T
where T[t,T ] denotes the set of stopping times τ of the ltration Ft with values
in [t, T ].
It is possible to prove (see Bensoussan and Lions (1984) [4] and Jaillet,
F is the solution of the PDE:
Lamberton, and Lapeyre (1990) [20]) that
2 2 2
min − ∂F − rS ∂F − σ S ∂ F + rF ; F − Φ = 0 t ∈ [0, T ], S ≥ 0,
∂t ∂S 2 ∂S 2
F (T, ST ) = Φ(ST ).
σ2 S 2 ∂ 2 F
∂F ∂F
+ rS + − rF ≤ 0 t ∈ [0, T ], S ≥ 0,
∂t ∂S 2 ∂S 2
F ≥ Φ(t, St ) t ∈ [0, T ], S ≥ 0,
2 2 2
∂F ∂F σ S ∂ F
+ rS + − rF (F − Φ) = 0 t ∈ [0, T ], S ≥ 0,
2 ∂S 2
∂t ∂S
F (0, S0 ) = Φ(0, S0 ) S ≥ 0.
When we compare the prices of European Calls and Puts with their American
counterparts, some important and counterintuitive results emerge. It can be
proved that the price of the two Calls will always be the same since the maximum
value of the expected payo is always at the last available moment T. Therefore,
exercising the American Call before maturity is not advantageous. On the other
hand, for the Put Option, there exists a region where the price of the American
Option coincides with the payo at that moment Φ(t, St ) = (K − St )+ . In this
region, the Option should be exercised since it is worth selling the underlying
asset to buy a risk-free asset. This region, where F (t, St ) = Φ(t, St ), is called
the region of exercise.
We will not focus on this type of Option since it is not the main topic of this
discussion. Curious readers can nd more details in the summary by Pascucci
1.3. OTHER OPTIONS: BARRIER, LOOKBACK, ASIAN, AND AMERICAN OPTIONS27
(2009) [25], which references the works of Bensoussan (1984) [3] and Karatzas
(1988, 1989) [21] [22] for a probabilistic approach based on the notion of the
Snell envelope in continuous time, Jaillet, Lamberton, and Lapeyre (1990) [20]
who employed variational techniques and provided a rigorous justication of the
numerical solution, Oksendal and Reikvam [28], Gatarek and wiech [15] who
employed the theory of viscosity solutions, Zhang [31] for a complete proof of
strong convergence of the schemes and an extension to models with jumps, and
of course, the book by Achdou and Pironneau (2005) [2], which devotes an entire
chapter to this topic. A nal reference is the article by Brennan and Schwartz
(1977) [7].
28 CHAPTER 1. BLACK-SCHOLES MODEL: A BRIEF RECAP
Chapter 2
Example 2.1 (Forward Euler Method ). The Forward Euler method is the sim-
plest method that can be applied to solve an ODE. The idea of this method is
to approximate the function y(t) through its tangent line at any point. This
leads to the approximating formula:
(
yn+1 = yn + hf (tn , yn )
yn=0 = y0
This is an explicit method of order 1, and it is also known for not being
A-stable. We will see later that this unstable behavior will be observable in our
implementation. Since we aim to avoid such instabilities, we will primarily use
implicit methods, which are generally more stable than explicit ones.
29
30CHAPTER 2. NUMERICAL METHODS: FINITE DIFFERENCES AND FEM
Example 2.6 (Embedded Runge Kutta Lobatto 3C and 3B ). These two methods
are dened respectively by the following tableaux:
1
0 6 − 13 1
6
1 1 5 1
2 6 12 − 12
1 2 1
1 6 3 6
1 2 1
6 3 6
− 12 2 − 12
and
1
0 6 − 16 0
1 1 1
2 6 3 0
1 5
1 6 6 0
1 2 1
6 3 6
− 21 2 − 12
These are known to be implicit embedded methods, both with an order of
convergence of 2. They are known for their stability and the ability to control
the computed error at each step.
Looking at the structure of the two tableaux, it is possible to notice an
important characteristic that makes the Runge-Kutta Lobatto 3B preferable:
its third column in the tableau is full of zeros. This is a remarkable property
because it makes the linear systems related to each step much easier to solve
without implying (at least in our case) a loss of stability. We will see this fact
in the results presented in Chapter 4, for example in Table 4.2 and Table 4.3.
Let's move on to solving PDE problems. Consider the boundary value prob-
lem, such as the Cauchy problem expressed by the general Feynman-Ka£ formula
(1.7), also reported here:
∂ 2 F (t, x)
∂F (t, x) ∂F (t, x) 1 2
+ µ(t, x) + σ (t, x) − rF (t, x) = 0
∂t ∂x 2 ∂x2 . (2.1)
F (T, x) = Φ(x)
32CHAPTER 2. NUMERICAL METHODS: FINITE DIFFERENCES AND FEM
There are at least two main ways to solve this numerically: using nite dier-
ences and using the nite element method (FEM). The rst method is simple
to describe in low dimensions but dicult to generalize to higher dimensions,
where FEM is often preferred.
h2 ′′ h3
u(xi+1 ) = u(xi ) + hu′ (xi ) + u (xi ) + u(3) (x̂i )
2 6
h2 ′′ h3
u(xi−1 ) = u(xi ) − hu′ (xi ) + u (xi ) − u(3) (x̃i )
2 6
from which
h2 ′′ h3 h4
u(xi+1 ) = u(xi ) + hu′ (xi ) + u (xi ) + u(3) (xi ) + u(4) (x̂i )
2 6 24
h2 ′′ h3 h4
u(xi−1 ) = u(xi ) − hu′ (xi ) + u (xi ) − u(3) (xi ) + u(4) (x̃i )
2 6 24
from which
Observation 2.7. The smoothness of the function u is key for the convergence
order of every nite dierence. It's important to note that the order of conver-
gence of a nite dierence can be proved only if the function is smooth enough
to have a well-dened Taylor expansion.
u(x1 ) − u(x3 )
∆u2 =
2h
.
..
u(xi−1 ) − u(xi+1 )
∆ui =
2h
.
..
∆u = u(xm−2 ) − u(xm )
m
2h
We can repeat the procedure for the second-order nite dierence, obtaining:
∗ ∗ ∗ ∗ ∗ ∗
−1 2 −1 0 ... 0
1 0 −1 2 −1 ... 0
∆2 u = 2 . u.
h .. .. .. .. ..
. . . . 0
0 ... 0 −1 2 −1
∗ ∗ ∗ ∗ ∗ ∗
Observation 2.8. These two matrices usually have some remarkable proper-
ties. They are almost always sparse, with non-zero elements on the diagonals,
and sometimes they are symmetric or skew-symmetric and diagonally dominant.
To ll the rst and last rows of these two matrices, we generally need to
consider the boundary conditions of our equation, especially since we may have
a PDE dened not only with initial/nal conditions but also on a specic domain
with xed values on the boundary. In our case, given by the Cauchy problem
2.1, we only have the nal condition F (T, x) = Φ(x) with F dened on the
whole real line. Therefore, we don't have any boundary conditions, and we
can simply ll the rst and last rows with some forward or backward nite
dierences, preserving the general order of convergence of the matrices (like
the example given earlier). We end up with two matrices A, B that we can
34CHAPTER 2. NUMERICAL METHODS: FINITE DIFFERENCES AND FEM
use to approximate the rst and second derivatives of a generic function with
second-order accuracy.
Now we are almost ready to discretize the Feynman-Ka£ formula with re-
spect to the spatial variable x, with x1 , . . . , x m on the interval [a, b]. We
only need to dene slightly dierent versions of the previous matrices since
µ and σ are both functions of (t, x). We will consider A′ , B ′ given by the
element-wise product between µ = (µ(t, x1 ), . . . , µ(t, xm )) and A, and between
σ 2 = (σ 2 (t, x1 ), . . . , σ 2 (t, xm )) and B :
A′ = [µ(t, xi )ai,j ]i,j , B ′ = [σ 2 (t, xi )bi,j ]i,j ,
Finally, we can discretize the spatial variable x using the vector F (t) = (F (t, x1 ), . . . , F (t, xm )),
obtaining:
∂F (t) 1
+ A′ F (t) + B ′ F (t) − rF (t) = 0
∂t 2
This is now a system of ODEs where the only remaining variable is t. Letting
Φ = (Φ(x1 ), . . . , Φ(xm )), we can rewrite it as:
∂F (t) 1
= (Ir − A′ − B ′ )F (t)
∂t 2
F (T ) = Φ
This is the classical form of a system of ODEs that can be solved using one of the
known methods (e.g., Euler method, θ-methods, or the Runge-Kutta family).
where
A′′ = [rsi ai,j ]i,j , B ′′ = [s2i σ 2 (t, si )bi,j ]i,j
This technique, despite being simple to understand and implement in the 1-
dimensional case, is dicult to generalize to higher dimensions without breaking
some of the properties of the matrices (like those mentioned in Observation 2.8)
that can be exploited while solving the system of ODEs. Most importantly,
it nds its natural application when we are dealing with a smooth function F
(Observation 2.7).
This last condition is generally not satised by our function F at maturity
(consider, for example, the payo of a Call Option, which is not dierentiable
at K ). Therefore, in our implementation, we will not be interested in nite
dierences with high orders of convergence since their gain is lost due to the
irregularity of our solution. Instead, we will focus on computing the solution
with smaller steps to achieve a better approximation.
2.3. FINITE ELEMENTS METHOD (FEM) 35
∂ 2 F (t, S)
∂F (t, S) ∂F (t, S) 1 2 2
− rS − S σ (t, S) + rF (t, S) = 0
∂t ∂S 2 ∂S 2 (2.2)
F (0, S) = Φ(S)
(v, w)L2 (R+ ) = R+ v(x)w(x) dx. It is a known result that the space D(R+ ) of
R
+ 2 +
smooth functions with compact support in R is dense in L (R ).
Let us introduce the space
Z x
2 +
W = w continuous on [0, +∞) : w(x) = ϕ(s) ds, with ϕ ∈ L (R )
0
w
≤ 2||w||W (2.3)
x L2 (R+ )
2 Z x 2
1
Z
w ′
= w (s) ds dx
x L2 (R+ ) R+ x2 0
Z x
2 ′
Z
= w (x) w′ (s) ds dx
+ x 0
ZR
2 ′
= w (x)w(x) dx
R+ x
w
≤2 ||w||W
x L2 (R+ )
36CHAPTER 2. NUMERICAL METHODS: FINITE DIFFERENCES AND FEM
dv
V = v ∈ L2 (R+ ) : x ∈ L2 (R+ )
dx
R+ .
where the derivative must be understood in the sense of the distribution on
dv dw
We can now endow V with the inner product (v, w)V = (v, w) + (x
p dx , x dx )
and with the Euclidean norm ||v||V = (v, v)V to complete V and obtain a
Hilbert space. Moreover, with these choices, we have that the space D(R ) is
+
dense in V.
dv
||v||L2 (R+ ) ≤ 2 x
dx L2 (R+ )
Z Z
dv
2 xv(x) (x) dx = − v 2 (x) dx
R+ dx R+
dv
||v||2L2 (R+ ) ≤ 2||v||L2 (R+ ) x
dx L2 (R+ )
With Poincaré's inequality, we can prove that the seminorm |v|V = ||x xv ||L2 (R+ )
is indeed a norm on V and that it is equivalent to || · ||V . Similarly, using the
density of D(R+ ) in L2 (R+ ), one can prove the following result:
Proposition 2.13. 2 +
If w ∈ L (R ), then the function v , dened as v(x) =
1 x
R
x 0 w(s) ds, belongs to V , and there exists a positive constant C independent
of w such that ||v||V ≤ ||w||L2 (R+ ) .
(w, v)
||w||V ′ = sup .
v∈V \{0} |v|V
2.3. FINITE ELEMENTS METHOD (FEM) 37
Now that we have introduced some function spaces useful for this discussion,
we can return to the Black-Scholes equation (2.2) and introduce what the weak
formulation of this problem means.
Let us multiply the PDE by a smooth real-valued function ξ(S) on R+ and
+
integrate in S on R . Assuming that integration by parts is permitted, we
obtain:
Z
d
0= F (t, S)ξ(S) dS
dt R+
S 2 σ 2 (t, S) ∂F
Z
∂ξ
+ (t, S) (S) dS
+ 2 ∂S ∂S
ZR
∂σ ∂F
+ −r(t) + σ 2 (t, S) + Sσ(t, S) (t, S) S (t, S)ξ(S) dS
R+ ∂S ∂S
Z
+ r(t) F (t, S)ξ(S) dS.
R+
S 2 σ 2 (t, S) ∂v ∂w
Z
0=+ dS
+ 2 ∂S ∂S
ZR
∂σ ∂v
+ −r(t) + σ 2 (t, S) + Sσ(t, S) (t, S) S w dS (2.4)
R + ∂S ∂S
Z
+ r(t) vw dS.
R+
There exist two positive constants, σ1 and σ2 , such that for all t ∈ [0, T ]
and all S ∈ R+ ,
0 < σ1 ≤ σ(t, S) ≤ σ2 .
There exists a positive constant Cσ such that for all t ∈ [0, T ] and all
S ∈ R+ ,
∂σ
S (t, S) ≤ Cσ .
∂S
The proof of this result is quite tedious and involves controlling each integral
with an estimate.
We recall the standard notationC 0 ([0, T ]; L2 (R+ )) as the space of continuous
2 + 2
functions on [0, T ] with values in L (R ), and L ((0, T ); V ) as the space of
square-integrable functions on (0, T ) with values in V . Assuming that Φ ∈
L2 (R+ ), we can prove the weak formulation for the Black-Scholes PDE [24].
38CHAPTER 2. NUMERICAL METHODS: FINITE DIFFERENCES AND FEM
σ2 2
at (v, v) ≥ |v| − λ||v||2L2 (R+ )
4 V
Theorem 2.17 (Existence of a Solution for the Weak Formulation).
If Φ ∈ L2 (R+ ) and under Hypothesis (2.14), the weak formulation (2.5) has a
unique solution.
The proof of this existence is given in [24]. Note that this result applies to
any European Option with a payo function in L2 (R+ ), particularly to vanilla
Puts. It does not apply to vanilla Calls, and we will revisit this later.
If the interest rate, the volatility, and the payo are smooth enough, then it is
possible to prove additional regularity for the solution of the Weak Formulation
(2.5) by calling At the unbounded operator in L2 (R+ ):
σ 2 (t, S)S 2 ∂ 2 v ∂v
At v = − 2
− r(t)S + r(t)v,
2 S S
it can be checked that for all t ∈ [0, T ] and for λ given by Gårding's inequality
2.16, the domain of At + λ is:
∂2v
+
D= v ∈ V : S2 ∈ L 2
(R ) .
S2
Hypothesis 2.18. There exist a positive constant C and 0<α<1 such that
for all t1 , t2 ∈ [0, T ] and S ∈ R+ :
∂σ ∂σ
|r(t1 ) − r(t2 )| + |σ(t1 , S) − σ(t2 , S)| + (t1 , S) − (t2 , S) ≤ C|t1 − t2 |α .
∂S ∂S
With the assumptions 2.14 and 2.18, it is possible to prove the so-called
smoothing eect: the solution of the weak formulation 2.5 belongs to D at any
time t > 0, for any Cauchy data Φ ∈ L2 (R+ ). More precisely, we have that:
With these three facts, we can apply the general results of Kato on parabolic
evolution equations [26], [10] and obtain the following results:
C
||At F (t)||L2 (R+ ) ≤ .
t
On the other hand, if Φ ∈ D, then the solution F of 2.5 belongs to C 0 ([t, T ]; D)
and
∂F
t ∈ C ([t, T ]; L (R+ )).
0 2
σ 2 t −2λ̃τ ∂F
Z
∂F ∂Φ 2
e−2λ̃t ∥S (t)∥2L2 (R+ ) + e |S (τ )|2V dτ ≤ ∥S ∥ 2 +
S 2 0 S S L (R )
Observation 2.21. As a consequence of this last proposition, the solution to
the weak formulation is continuous if Assumption 2.14 is satised and Φ∈V.
It is easy to notice that these results apply to a European vanilla Put because
Φ = (K − S)+ ∈ V but they don't apply to a European vanilla Call.
Now that we have some results that ensure the regularity of the solution given
certain assumptions, we want to study other properties of the solution given by
the weak formulation. In particular, we want to prove that some results already
known in nance are ensured by this formulation. For example, we will see that
the positivity of the pricing function is guaranteed, that the Put-Call Parity is
ensured, and that every pricing function is controlled by other pricing functions
if its payo is controlled by their payos.
To achieve these results, we have to state the Maximum Principle for a class
of functions much larger than V and understand its consequences. For a deep
dive into the maximum principle, the reader can refer to Protter, Murray, and
Weinberger [27]. We dene the function space:
n 2
o
V = v : ∀ ε > 0, v(S)e−ε log (S+2) ∈ V
Theorem 2.22 (Weak Maximum Principle). Let u(t, S) be such that for
all positive numbers ε:
2
1. ue−ϵ log (S+2)
∈ C 0 ([0, T ]; L2 (R+ )) ∩ L2 (0, T ; V ),
∂u −ϵ log2 (S+2)
2.
t e ∈ L2 (R+ ×(0, T )),
3. u|t=0 ≥ 0 a.e.,
∂u
4.
t + At u ≥ 0 (in the sense of distributions);
40CHAPTER 2. NUMERICAL METHODS: FINITE DIFFERENCES AND FEM
This theorem may be generalized using the previous assumptions and using a
function that satises the weak formulation 2.5, but for our purposes, this result
is sucient for deriving the consequences we are looking for. That's because
the maximum principle is an extremely powerful tool for proving estimates on
the solution of elliptic and parabolic PDEs.
Proposition 2.23. Under Assumption 2.14, let F be the weak solution to 2.5,
with Φ ∈ L2 (R+ ) a bounded function, i.e., 0 ≤ Φ ≤ Φ(S) ≤ Φ. Then, a.e.:
Rt Rt
Φe− 0
r(τ )dτ
≤ F (t, S) ≤ Φe− 0
r(τ )dτ
Proposition 2.24. Under Assumption 2.14, let F be the weak solution to 2.5,
with Φ(S) = (K − S)+ , then we have that:
Rt Rt
(Ke− 0
r(τ )dτ
− S)+ ≤ F (t, S) ≤ Ke− 0
r(τ )dτ
(2.7)
and: Rt
P (t, 0) = Ke− 0
r(τ )dτ
.
This last result is important because we didn't impose the boundary condi-
tion 2.7 a priori. Indeed, it arises naturally both in nite dierences and nite
elements.
Rt
C(t, S) = S − Ke− 0
r(τ )dτ
+ P (t, S).
Rt
From the fact that P and S − Ke− 0
r(τ )dτ
satisfy 2.2, it is clear that C is a
solution of the same PDE 2.2 with the Cauchy condition C(0, S) = (S − K)+ .
This is precisely the boundary value problem for the European vanilla Call
Option. On the other hand, from the Maximum Principle, we know that a well-
behaved solution (in the sense of the weak maximum principle hypothesis 2.22)
to this boundary value problem is unique. Therefore, we can deduce the price
of the Call Option from that of the Put Option: we recover the Put-Call parity
seen in Chapter 1 and well known to nancial players.
If we now consider some results regarding the desired convexity of the pricing
function F in the variable S, we need a new assumption.
2.3. FINITE ELEMENTS METHOD (FEM) 41
∂2σ
|S 2 (t, S)| ≤ C a.e.
S2
Proposition 2.28. F be the weak so-
Under Assumptions 2.14 and 2.27, let
∂2Φ
lution to 2.5, where Φ ∈ V is a convex function such that
S 2 has a compact
support. Then, for all t > 0, F (t, S) is a convex function of S .
Proposition 2.29. Under Assumption 2.14, we have, for all t ∈ [0, T ] and for
all S > 0:
F (t, S) ≤ F (t, S) ≤ F̄ (t, S)
where F (resp., F̄ ) is the solution to 2.5 with σ=σ (resp., σ̄).
σ 2 S 2 ∂ 2 F̃
∂ F̃ ∂ F̃
− − rS + rF̃ = 0, t ∈ (0, T ], S ∈ (0, S̄)
t 2 S2 S
F̃ (S̄, t) = 0, t ∈ (0, T ]
with the Cauchy data F̃ (S, 0) = (K −S)+ in (0, S̄). The theory of weak solutions
applies to this new boundary value problem, but one has to work in the new
Sobolev space:
∂v
Ṽ = {v, S ∈ L2 ((0, S̄)), v(S̄) = 0}.
S
The results of previous theorems can be transferred to this new BVP. The
question is how to estimate the error between F and F̃ . For that, we use a
version of the maximum principle adapted to 2.3, the proof of which is omitted
for brevity. We ultimately obtain the following result:
Proposition 2.30. Under Assumption 2.14, the error maxt∈[0,T ],S∈[0,S̄] |F (t, S)−
F̃ (t, S)| decays faster than any exponential exp(−η S̄)(η > 0) as S̄ → ∞.
h
X
v̂ = v̂j ϕj (x).
j=1
Observation 2.31. The mesh does not need to be regular. In fact, it is gen-
erally advantageous to use an adaptive mesh to focus computational eort on
regions where the solution is less regular.
Variational Framework
Let us dene the framework for the FEM approach:
Figure 2.1: Mismatch between the real domain Ω and the computational domain
Ω̄.
(a) Mesh for Put Option on the (b) Mesh for Put Option on the
max of two stocks min of two stocks
44CHAPTER 2. NUMERICAL METHODS: FINITE DIFFERENCES AND FEM
κ : Ω 7→ R2×2 , α : Ω 7→ R2 , β : Ω 7→ R, b : Γn 7→ R.
∂u − ∇ · (κ∇u) − ∇ · (αu) + βu = ψ
in Ω × (0, T ),
∂t
u|t=0 = u0 (x) in Ω, (2.8)
u=g on Γd × (0, T ),
−bu − (κ∇u) · n = f on Γn × (0, T ).
Assuming that:
For almost every x ∈ Ω, κ(x) is a symmetric tensor and there exist two
positive constants 0 < κ ≤ κ̄ such that, for all ξ ∈ R2 ,
Thanks to the bounds on a(v, w), it can be shown that if ug satisfying the
above condition exists, then the variational formulation has a unique solution,
which satises the rst line of 2.8 in the sense of distributions.
2.3. FINITE ELEMENTS METHOD (FEM) 45
h
X
v̂ = v̂j ϕj (x).
j=1
This decomposition allows us to easily obtain the value of v at node j as v̂j and
simplies our calculations by recognizing that the basis functions are non-zero
only in a limited number of elements. Indeed, when we consider the variational
formulation 2.9 on the function û ∈ Vh , it suces to verify the equation for the
basis functions, i.e.:
Z Z
∂ û
∀ϕi ∈ (ϕi )i , (t), ϕi + a(û(t), ϕi ) = ψ(t)ϕi + f (t)ϕi . (2.10)
∂t V Ω Γn
P
Taking the orthogonal decomposition û = i ûi ϕi and recalling the linearity
of the bilinear form a and the linearity of the integral operator (·, ·)V , we get:
h h Z Z
X ∂ϕj X
ûj , ϕi + ûj a(ϕj (t), ϕi ) = ψ(t)ϕi + f (t)ϕi .
j=1
∂t V j=1 Ω Γn
Z Z
∂ϕj
Ai,j = , ϕi + a(ϕj (t), ϕi ) and bi = ψ(t)ϕi + f (t)ϕi .
∂t V Ω Γn
Thanks to the basis functions used, most of the products between two basis
functions are zero. Indeed, this product is non-zero only if the nodes i and j of
ϕi and ϕj are adjacent (Figure 2.4). Therefore, the matrix A is sparse and can
be computed using a local approach: building the matrix A element by element
is simpler than doing it node by node. For example, if we have an element e
with vertices N1 , N10 , N23 , we obtain:
a1,1 ... a1,10 ... a1,23 ...
.. .. .. .. ..
.
. . . . . . .
a10,1 ... a10,10 ... a10,23 . . .
A= . .
.. .. .. ..
.. . . . . . . .
a23,1 ... a23,10 ... a23,23 . . .
.. .. .. .. .. ..
. . . . . .
(Of course, we can sum above the main diagonal and use the symmetry of A to
ll in the values below.)
We are now interested in computing the local products for the local matrix,
which depends on the specic problem being solved.
If we focus on the classical Black-Scholes equation, using the bilinear form
dened in 2.4, we can easily compute the matrix A and have everything needed
to solve our problem numerically.
Let's consider the case of a knockout boundary option on a single asset, where
the boundary does not depend on time. In this scenario, the option becomes
worthless if the price of the underlying asset exits the interval [b, B]. Conse-
quently, the price of the option satises the usual Black-Scholes equation with
a new boundary condition on the barriers:
F (t, b) = F (t, B) = 0.
The domain Ω is then restricted to the interval [b, B], and the previous
arguments still apply by using the space:
2 ∂v 2
V = v ∈ L (Ω) : ∈ L (Ω); v (b) = v (B) = 0
∂S
when there is a lower constraint, and:
2 ∂v 2
V = v ∈ L (Ω); S ∈ L (Ω); v (B) = 0
∂S
when there isn't a lower constraint.
The same argument holds true when we consider basket options. For exam-
ple, if we have two assets S1 and S2 with barriers b1 , B1 and b2 , B2 , respectively,
the new domain becomes Ω = [b1 , B1 ] × [b2 , B2 ] with the boundary condition:
F (t, s1 , s2 ) = 0 on ∂Ω.
Let's consider, for simplicity, the case of an option on two assets. We assume,
as before, that these assets follow the dynamics described in equation 1.10. In
this case, we dene the function space as:
∂v ∂v
V = v : v, S1 , S2 ∈ L2 (R2+ ) .
∂S1 ∂S2
48CHAPTER 2. NUMERICAL METHODS: FINITE DIFFERENCES AND FEM
Among the payos mentioned in Section 1.2, we observe that the payos given
by 1.12 and 1.13 belong to L2 (R2+ ), while the payo given by 1.14 does not. For
2 2
the following discussion, we assume that the payo belongs to L (R+ ).
We introduce the bilinear form:
2
1 X
Z
∂v ∂w
a(v, w) = Mk,l Sk Sl dS
2
R+ 2 ∂S k ∂Sl
k,l=1
2 2
!
1
Z X X ∂v
+ −r + Mk,l Sk w dS
2
R+ k=1 2 ∂Sk
l=1
Z
+r vw dS.
R2+
∂F
∈ L2 (0, T ; V ′ ), and (2.11)
∂t
F |t=0 = Φ in R2+ ,
2 2
∂F 1 X ∂2F X ∂F
− M S S
k,l k l − rSk + rF = 0, t ∈ (0, T ],
∂t 2 ∂Sk ∂Sl ∂Sk
k,l=1 k=1
F (0, S1 , S2 ) = Φ(S1 , S2 ), (S1 , S2 ) ∈ Ω,
F (t, S1 , S2 ) = 0
on ∂Ω,
Program implementation
We decided to develop our OOP (Object-Oriented Programming) implemen-
tation using the Python language and the famous NumPy library [18], which
is well-known for numerical computation in Python. Python natively lacks a
built-in array and matrix data structure (it uses lists by default). However, since
2005, NumPy has provided multidimensional array objects implemented in the
C programming language. With this tool, we can perform faster numerical com-
putations and have array objects with their expected behavior. Furthermore,
we can use sparse matrices and sparse arrays via the Scipy library [30], which
uses NumPy to interface with C.
Another important library we will use later is PyFreeFem [19], an API that
allows us to run code written in the FreeFem language from within our Python
program.
The basic structure of the project is shown in Figure 3.1. Before discussing
each object in detail, it's important to provide an overview to understand the
relationships between the main classes. Using a top-down approach, the rst
class to discuss is the Discretizer. This class is dened by several components:
TimeMethod: Represents the method used to solve the ODE linear system.
Dynamics: Denes the model used to simulate the stock's random walk.
Option: Represents the option for which we want to compute the fair
value.
49
50 CHAPTER 3. PROGRAM IMPLEMENTATION
Figure 3.1: General overview of the OOP project. Some details are omitted for
clarity.
Another key part of the implementation is the OptionType class, which maps
all the options discussed in previous chapters. We achieved this by combining
three dening aspects for each option using the Enum classes DimensionType,
ExerciseType, and PayoffType, which we will discuss in detail later. To con-
struct an option, it's mandatory to pass in all relevant market parameters, such
as strike price, time to maturity, and the values of any lower or upper barriers.
Given the complexity of all these classes required to compute the fair price
of an option, we also implemented a Builder class. This class ensures the
correct construction of all objects, given an intuitive set of parameters dened
by the user based on the current market conditions. The Builder also helps
manage dependencies between objects, allowing the user to interact with just a
few high-level classes while the program handles the rest.
Now that we have provided this preliminary overview, we can start analyzing
each class in detail, using a bottom-up approach. This means starting with
simpler classes and progressively moving towards the more complex ones, which
combine multiple objects.
classes that utilize it. Additionally, another advantage of using these classes is
the "type safety" guaranteed by the fact that numerical enumerators or strings
are not used in the code to propagate information. This minimizes the risk of
errors due to typos, which could potentially lead to issues with code stability.
Generally speaking, the use of an Enum class is always recommended when there
is a need for clearly dened, limited sets of options.
The Enum classes that we dened are:
ExerciseType: Denes the type of exercise allowed for the option. Cur-
rently, the only possible value is European, but other values like American
or Bermuda could be introduced in future development.
52 CHAPTER 3. PROGRAM IMPLEMENTATION
The Option class has several methods, most of which are getters for the inner
OptionType class, and we will not discuss them in detail here. Instead, we will
focus on the two methods compute_payoff and convert_to_fair_price:
Among the methods belonging to the Dynamics class, we want to focus our
attention on the following:
The other getter methods are key for the interaction between the Dynamics
and the Discretizer, but their implementation is straightforward and intuitive.
They call the corresponding getter method for the inner class with the correct
parameters (the discretized domain and the current time).
The rst implementation of this class is the concrete class BlackScholesModel,
which provides implementations for all the discussed methods and has the fol-
lowing eld attributes:
get_domain: Returns the initial space domain used to compute the solu-
tion. This domain is expressed as a list of 2-dimensional lists, where each
element of the outer list represents the interval on the respective dimen-
sion (e.g., the list [[0,100], [20, 200]] corresponds to the Cartesian
product in [0, 100]×[20, 200] in R2 ). Note that the domain specied by the
user can be truncated during the construction of the discretized domain
for options like Barrier Options, because for them, the PDE is dened
only in a specic region of the domain and they have boundary conditions
3.4. DISCRETIZER CLASS 57
Euler and Crank-Nicolson methods, and these are the only two methods
applied in our scope. This method requires the value of theta correspond-
ing to the desired method.
(p−1)
1/p
tola + yn · tolr
kn+1 = min 2, max 0.5, 0.7 · · kn
(p) (p−1)
yn − yn
(3.1)
(p−1) (p)
where yn , yn are the two dierent estimates at step n with orders
p−1 and p. The norm used is the innity norm, and kn is the step size
at step n. Using this formula, changes in step size are proportional to the
computed error and the given tolerances but without abrupt changes in
step size.
On the other hand, the FEM implementation of the same method uses
the PyFreeFem package to execute code with the FreeFem compiler. This
choice allows us to access a well-developed set of methods native to this
language, such as the ability to easily perform mesh adaptation and the
automatic translation from the variational formulation of the FEM prob-
lem to its solution. For our purposes, we implemented a mesh adaptation
with the function adaptmesh on a fespace with polynomials of degree 1,
then solved the variational problem by imposing the boundary condition
and using the convect formula for the convective term. Between these
steps, it's possible to retrieve the discretized matrix for debugging the
code or performing some analysis, though it is more ecient to abandon
OOP habits for a more ecient FreeFem single-run calculation.
plot_fair_price: This method generates the plot for the computed fair
value and compares it with the analytical one (when available) and with
the payo when requested by the user. This method was used to generate
the plots in Chapter 4.
BarrierOptionDiscretizer
One last class we would like to mention is the
class, which inherits from the FiniteDifferencesDiscretizer. This is a nec-
essary step to correctly price a barrier option since, unlike the general option
case, the PDE presents a homogeneous boundary condition on every barrier, and
the domain itself is reduced by the presence of the barrier. This behavior was
3.5. BUILDER CLASS 61
Numerical Results
4.1 European Options in 1 Dimension
In this chapter, we present the results of our implementation discussed in the
previous chapter. We report on the accuracy of the developed methods by test-
ing their convergence and, when possible, by comparing the error with analytical
solutions.
Since we are dealing with an OOP implementation, it is unnecessary to test
every possible combination of the objects we developed. Proving that the in-
teractions between classes are correct ensures that any new object (if correctly
developed) will benet from the established implementation. For example, we
will not present the tests for all combinations of payos, time methods, and
space methods performed during development. Instead, we will present indi-
vidual results that demonstrate the correctness of payo implementation or
method implementation. In a few cases, we will present the complete results
that combine these individual results to conrm the overall correctness of our
program.
Let's begin with some generic examples to qualitatively verify that our pro-
gram computes results in accordance with theoretical expectations. Consider a
framework with a single stock St and price European Calls, Puts, Digital Calls,
and Digital Puts on it, with dierent volatility σ, interest rate r, and dividend
rate q. All options have a strike K = 100, time to maturity T = 1, on the
domain [0.1, 200]. We computed the prices of these options using the Backward
Euler method for time discretization and the second-order Finite Dierences
method for space discretization on the given domain using 1000 time steps and
1000 space discretizations.
In Figures 4.1, 4.2, 4.3, 4.4, and 4.5, we present all the computed prices.
For each option, we also plot the corresponding analytical price (which overlaps
with our computed price) and the option payo.
From these results, it is evident that the computed price consistently over-
laps with the analytical price. Our program correctly predicts the analytical
price under various market conditions and manages the presence of a constant
dividend rate. In Table 4.1, the error with respect to the analytical solution
and the computation time are reported. For each run, the error is lower than
0.01, and in some cases, it is even lower than 0.001. This observation is rele-
63
64 CHAPTER 4. NUMERICAL RESULTS
Figure 4.3: Computed and analytical options' prices with σ = 0.2, r = 0.03, q =
0.
4.1. EUROPEAN OPTIONS IN 1 DIMENSION 67
Figure 4.4: Computed and analytical options' prices with σ = 0.2, r = 0.06, q =
0.
68 CHAPTER 4. NUMERICAL RESULTS
Figure 4.5: Computed and analytical options' prices with σ = 0.2, r = 0.03, q =
0.01.
4.1. EUROPEAN OPTIONS IN 1 DIMENSION 69
vant because, in the nancial market, most bid and ask prices are expressed in
cents, with only a few cases using thousandths. Therefore, an error lower than
this tick size is sucient for our program. Moreover, the computation time is
reasonable given our setup, and with better hardware, the same computation
could be performed even faster.
With these preliminary results, we have shown that the computed results are
correct. However, the computation time varies depending on the method used.
As previously discussed, our program allows the use of dierent time methods
and nite dierence orders. In short, we have the following time methods:
Forward Euler, Backward Euler, Crank-Nicolson, Explicit Embedded Runge-
Kutta 2, Diagonally Implicit Runge-Kutta 3, Embedded Runge-Kutta Lobatto
3C, and Embedded Runge-Kutta Lobatto 3B. The nite dierence methods are
available in second and fourth-order versions.
To study the errors and computational times of the dierent time methods
used to solve the same problem, we again consider the previous framework with
σ = 0.2, r = 0, q = 0 and compute the price for a European Call using 1000 time
steps and 500 space discretizations for the second order and 2000 time steps and
300 space discretizations for the fourth order. Tables 4.2 and 4.3 present the
results.
From these results (and from other runs that are not reported here), it
is evident that some methods are generally better than others in achieving a
similar error in less time. For example, Crank-Nicolson is unsurprisingly slightly
faster than Backward Euler, but the fastest method is Runge-Kutta Lobatto 3B,
which computes the solution in 36 millisecondsan interesting computation
time for a high-frequency trading program, for instance. The Forward Euler
70 CHAPTER 4. NUMERICAL RESULTS
method, however, did not converge due to its instability when the time step
is not suciently smaller than the space discretization. This characteristic is
well-known for the Forward Euler method (and explicit methods in general) and
results in a model that is too parameter-dependent, making it unfeasible for our
implementation. For this reason, we focus on implicit methods to ensure greater
stability. Regarding space discretization methods, the fourth-order method can
compute reasonable results, but it does not guarantee better performance due
to the irregularity of the payo function and the more complex matrices that
complicate the resolution of the associated linear system.
In conclusion, the Runge-Kutta Lobatto 3B method is an interesting model
for this type of computation and will undoubtedly consume less time on better
hardware and after parameter tuning. On the space side, since most of our
applications will involve payos that are not dierentiable (or continuous), we
will not use the fourth-order nite dierences method as a reference but will
instead rely on its second-order counterpart.
Table 4.2: Comparison between Time Methods with second-order nite dier-
ences.
Table 4.3: Comparison between Time Methods with fourth-order nite dier-
ences.
1 With the given discretization of 1000 time steps and 500 spatial discretization points for
the 2nd discretization order (resp. 2000 and 300 for the 4th discretization order), we observe
the instability of the Forward Euler method because the length of the time step is not small
enough to adequately handle the space discretization error.
4.1. EUROPEAN OPTIONS IN 1 DIMENSION 71
Backward Euler and Crank-Nicolson in time, on the domain [0.1, 200] with time
to maturity T = 1. Figure 4.6 shows the order of convergence between the
computed solution and the analytical one for the four dierent computations,
with space subdivisions of (50, 100, 150, 200, 250, 300) and 10000 time steps.
It is clear from this gure that our program struggles to achieve an error lower
than 1e-3, and moreover, the error does not decay as expected. This is because
we are trying to solve the Black-Scholes equation, which is naturally dened on
the half-line R+ , on a truncated domain [0.1, 200]. This unavoidable truncation
generates an error on the right boundary during pricing since it is impossible to
impose a boundary condition on the right side that would correct this behavior.
Indeed, if we look at the point-wise error between the computed and analytical
solutions (Figure 4.7 for the point-wise error of the second-order Backward Euler
computation; similar results were found in other cases), we can clearly see that
our program correctly manages the pricing around the strike, with a decay of
the error, but it maintains a constant error on the right boundary. Considering
the error between the computed solutions and a reference solution with 1000
space subdivisions and 10000 time steps (Figure 4.8), we see that our program
correctly follows the error decay of the space discretization but converges to
the wrong solution used as a reference. From this, we can conclude that our
implementation is correct but corrupted by the impossibility of solving the given
problem in its proper domain. Nevertheless, this error is always around 1e-3 and
is located far from the strike, where options are usually more liquid, making the
error negligible compared to the usual bid-ask spread, which would be signicant
for options that are far out of the money (or far in the money).
Moving on to the time method order of convergence, we observe the same
problem discussed above: all methods struggle to correctly estimate the solution
on the right boundary due to the truncation of the domain. In the convergence
graph in Figure 4.9, this behavior is not visible when compared with the analyt-
ical solution because of the chosen step size, but it becomes more evident with
ner meshes. In Figure 4.10, we see that all the methods achieve their expected
order of convergence when compared with a reference solution.
A specic discussion is required for the only embedded time model we de-
veloped. For this type of model, a classic order of convergence analysis is not
meaningful. Instead, it is possible to test whether the developed model can
match its time step size to the problem in such a way as to achieve the desired
absolute and relative tolerances. Indeed, solving the same pricing problem for a
Call Option with σ = 0.2, r = 0.3, q = 0, K = 100 on the domain [0.1, 200] with
time to maturity T = 1 using second-order nite dierences, and using dierent
tolerances, we obtain Figure 4.11 and Table 4.4, where the input tolerances and
the output results are reported.
From these results, it is clear that our model correctly adapts the time step
size to the problem to achieve the desired tolerance. Looking at the log-log
plot, we see that all the points lie on a straight line, and the error is always
lower than the requested tolerance. Unfortunately, the time required for this
computation is too long compared to the time required by the Runge-Kutta
Lobatto 3B method presented earlier. Therefore, our best choice remains the
Runge-Kutta Lobatto 3B method.
To conclude the discussion for the 1-dimensional case, we can state that, as
expected, the implicit methods are preferable for this type of problem. Among
them, the Runge-Kutta 3B method stands out in terms of order of convergence
72 CHAPTER 4. NUMERICAL RESULTS
(a) Second-order nite dierence with (b) Second-order nite dierence with
Backward Euler. Crank-Nicolson.
(c) Fourth-order nite dierence with (d) Fourth-order nite dierence with
Backward Euler Crank-Nicolson.
Figure 4.6: Space error order of convergence w.r.t. the analytical solution.
Table 4.4: Comparison of Errors and Elapsed Time for Dierent Tolerance
Values
4.1. EUROPEAN OPTIONS IN 1 DIMENSION 73
Figure 4.7: Point-wise error w.r.t the analytical solution for the second-order
Backward Euler computation.
74 CHAPTER 4. NUMERICAL RESULTS
(a) Second-order nite dierence with (b) Second-order nite dierence with
Backward Euler. Crank-Nicolson.
(c) Fourth-order nite dierence with (d) Fourth-order nite dierence with
Backward Euler Crank-Nicolson.
Figure 4.8: Space error order of convergence w.r.t. the reference solution.
4.1. EUROPEAN OPTIONS IN 1 DIMENSION 75
(a)Order of convergence for the Backward (b) Order of convergence for the Crank-
Euler method. Nicolson method.
(c)Order of convergence for the Explicit (d) Order of convergence for the Runge-
Runge-Kutta 3 method. Kutta Lobatto 3B method.
Figure 4.9: Time order of convergence for some of the implemented time meth-
ods w.r.t. the analytical solution.
76 CHAPTER 4. NUMERICAL RESULTS
(a)Order of convergence for the Backward (b) Order of convergence for the Crank-
Euler method. Nicolson method.
(c)Order of convergence for the Explicit (d) Order of convergence for the Runge-
Runge-Kutta 3 method. Kutta Lobatto 3B method.
Figure 4.10: Time order of convergence for some of the implemented time meth-
ods w.r.t. the reference solution.
and computational time. We are optimistic that, with better machines, the
computation can be performed in less time, making it possible to use this tool
to price European Options in a few milliseconds, as required for high-frequency
trading models in the event of volatility or interest rate shocks. Furthermore, it
may be possible to consider using these models after tuning the parameters to
perform the computation on a smaller domain, thereby neglecting points near
the boundaries where we are not interested in estimating a price.
divisions. The results are shown in Figures 4.16, 4.17, and 4.18. These results
are qualitatively consistent with nancial intuition, though a deeper analysis is
not possible without an analytical formula. Nonetheless, we are satised with
these results because we were able to validate the prices when possible, and the
qualitative behavior is as expected. The reader should note that the diering
proles in these gures are due to the fact that while the payo intervals are
the same length (30) in both cases, the options provide payos in dierent re-
gions of the half-line R+ , leading to slight dierences in the expected probability
distribution under the Black-Scholes model.
(a) Down-and-Out Put Option with bar- (b) Down-and-Out Put Option with bar-
rier b = 20. rier b = 40.
(c) Down-and-Out Put Option with bar- (d) Down-and-Out Put Option with bar-
rier b = 60. rier b = 80.
Figure 4.12: Computed Option price compared with analytical Option price for
some Down-and-Out Put Options.
(a) Up-and-Out Call Option with barrier (b) Up-and-Out Call Option with barrier
B = 120. B = 140.
(c) Up-and-Out Call Option with barrier (d) Up-and-Out Call Option with barrier
B = 160. B = 180.
Figure 4.13: Computed Option price compared with analytical Option price for
some Up-and-Out Call Options.
80 CHAPTER 4. NUMERICAL RESULTS
(a) Point-wise error for Down-and-Out (b) Point-wise error for Down-and-Out
Put Option with barrier b = 20. Put Option with barrier b = 40.
(c) Point-wise error for Down-and-Out (d) Point-wise error for Down-and-Out
Put Option with barrier b = 60. Put Option with barrier b = 80.
Figure 4.14: Point-wise error between the computed Option price and the ana-
lytical Option price for some Down-and-Out Put Options.
4.3. ASIAN OPTIONS IN 1 DIMENSION 81
(a)Point-wise error for Up-and-Out Call (b) Point-wise error for Up-and-Out Call
Option with barrier B = 120. Option with barrier B = 140.
(c)Point-wise error for Up-and-Out Call (d) Point-wise error for Up-and-Out Call
Option with barrier B = 160. Option with barrier B = 180.
Figure 4.15: Point-wise error between the computed Option price and the ana-
lytical Option price for some Up-and-Out Call Options.
(a) Price for a double knockout Call Op- (b) Price for a double knockout Call Op-
tion with barriers b = 120, B = 150. tion with barriers b = 50, B = 80.
Figure 4.16: Computed price for Call and Put Options with double knockout
barriers.
82 CHAPTER 4. NUMERICAL RESULTS
Option Type Lower Barrier Upper Barrier Error Elapsed Time (s)
Call 0 110 3.781e-5 0.772
Call 0 120 1.214e-4 0.687
Call 0 130 1.894e-4 0.648
Call 0 140 3.713e-4 0.575
Call 0 150 2.780e-4 0.547
Call 0 160 2.706e-4 0.543
Call 0 170 3.894e-4 0.544
Call 0 180 4.195e-4 0.559
Call 0 190 4.963e-4 0.551
Put 10 inf 0.1677 0.680
Put 20 inf 0.0337 0.694
Put 30 inf 0.0117 0.645
Put 40 inf 0.0050 0.827
Put 50 inf 0.0023 0.825
Put 60 inf 0.0011 0.618
Put 70 inf 0.0005 0.718
Put 80 inf 0.0002 0.696
Put 90 inf 6.029e-5 0.664
Table 4.5: Comparison of Errors and Elapsed Time for Dierent Option Barriers
(a) Price for a knockout Digital Call Op- (b) Price for a knockout Digital Call Op-
tion with barrier b = 120. tion with barrier b = 150.
Figure 4.17: Computed price for Digital Call Options with single knockout
barriers.
4.3. ASIAN OPTIONS IN 1 DIMENSION 83
(a) Price for a knockout Digital Put Op- (b) Price for a knockout Digital Put Op-
tion with barrier B = 50. tion with barrier B = 70.
Figure 4.18: Computed price for Digital Put Options with single knockout bar-
riers.
From this, we derive the transformation for the term (A−K) used in our oating
strike Asian Call:
T t−T
(A − K) = − Sξ + K = −Sξ,
t t
and the payo becomes:
Φ̃ = (−ξ)+ ,
obtained the plot in Figure 4.19, using the usual market parameters σ = 0.2,
r = 0.3, q = 0, K = 100, and solving on the space domain (0, 200). In the
gure, the x-axis is represented as the moneyness according to the previously
discussed development.
Since an analytical price for this type of option is not currently available, we
cannot directly compare our results to validate the implementation. However,
we are condent in its correctness due to the shape of the solution, which aligns
with nancial intuition.
issues, as shown in Figure 4.21. The results presented in Figures 4.20 and 4.21
are based on a market framework with constant parameters σ = 0.2, r = 0.03,
q = 0, and a correlation between the two stocks of ρ = 0.3, on the domain
[0.01, 200], with a strike price of 100.
(a) Price for a Put Option with payo (b) Price for a Put Option with payo
1.12. 1.13.
Figure 4.20: Computed price for Put Options with dierent payos.
86 CHAPTER 4. NUMERICAL RESULTS
(a) Price for a Call Option with payo (b) Price for a Call Option with payo
1.15. 1.16.
Figure 4.21: Computed price for Call Options with dierent payos.
Bibliography
[1] Yves Achdou, Olivier Bokanowski, and Tony Lelièvre. Partial dierential
equations in nance. In: The Encyclopedia of Financial Models 2 (2012).
[2] Yves Achdou and Olivier Pironneau. Computational methods for option
pricing. SIAM, 2005.
[3] Alain Bensoussan. On the theory of option pricing. In: Acta Applicandae
Mathematica 2 (1984), pp. 139158.
[4] Alain Bensoussan and Jacques Louis Lions. Impulse control and quasi-
(No Title) (1984).
variational inequalities. In:
[5] Tomas Björk. Arbitrage theory in continuous time. Oxford university press,
2009.
[9] John Charles Butcher. Numerical methods for ordinary dierential equa-
tions. John Wiley & Sons, 2016.
[10] Thierry Cazenave and Alain Haraux. An introduction to semilinear evo-
lution equations. Vol. 13. Oxford University Press, 1998.
[11] Antoine Conze and Viswanathan. Path dependent options: The case of
lookback options. In: The Journal of Finance 46.5 (1991), pp. 18931907.
[12] Black F. and Scholes M. The pricing of options and corporate liabilities.
In: Journal of political economy 81.3 (1973), pp. 637654.
[15] Dariusz Gatarek and Swiech Andrzej. Optimal stopping in Hilbert spaces
and pricing of American options. In: Mathematical methods of operations
research 50.1 (1999), pp. 135147.
87
88 BIBLIOGRAPHY
[16] M Barry Goldman, Howard B Sosin, and Mary Ann Gatto. Path de-
pendent options:" Buy at the low, sell at the high". In: The Journal of
Finance 34.5 (1979), pp. 11111127.
[17] Ernst Hairer, Syvert Paul Nørsett, Gerhard Wanner, et al. Solving Ordi-
nary Dierential Equations I [electronic resource]: Nonsti Problems. In:
().
[18] Charles R. Harris et al. Array programming with NumPy. In: Nature
585.7825 (Sept. 2020), pp. 357362. doi: 10.1038/s41586-020-2649-2.
url: https://doi.org/10.1038/s41586-020-2649-2.
[19] Frédéric Hecht et al. FreeFem++ Documentation. Version 4.9. 2021. url:
https://doc.freefem.org/.
[20] Patrick Jaillet, Damien Lamberton, and Bernard Lapeyre. Variational
inequalities and the pricing of American options. In: Acta Applicandae
Mathematica 21 (1990), pp. 263289.
[21] Ioannis Karatzas. On the pricing of American options. In: Applied math-
ematics and optimization 17.1 (1988), pp. 3760.
[23] Angelien Gertruda Zinnia Kemna and Antonius Cornelis Franciscus Vorst.
A pricing method for options based on average asset values. In: Journal
of Banking & Finance 14.1 (1990), pp. 113129.
[24] Enrico Magenes and Jacques Louis Lions. Problèmes aux limites non
homogènes et applications. In: (No Title) (1968).
[25] Andrea Pascucci. A short course on American options. 2009.
[29] L Chris G Rogers and Zo Shi. The value of an Asian option. In: Journal
of Applied Probability 32.4 (1995), pp. 10771088.
[30] Pauli Virtanen et al. SciPy 1.0: Fundamental Algorithms for Scientic
Computing in Python. In: Nature Methods 17 (2020), pp. 261272. doi:
10.1038/s41592-019-0686-2.
[31] Xiao Lan Zhang. Numerical analysis of American option pricing in a
jump-diusion model. In: Mathematics of Operations Research 22.3 (1997),
pp. 668690.