Professional Documents
Culture Documents
CompFin 2020 SS QF Sheet 11
CompFin 2020 SS QF Sheet 11
CompFin 2020 SS QF Sheet 11
Mathematisches Seminar
Prof. Dr. Sören Christensen
Adrian Theopold, Henrik Valett Sheet 11
Computational Finance
Exercises for all participants
C-Exercise 32
Write a python function
that computes the initial price of a European call option in the Black-Scholes model via the
Laplace transform approach. I.e., implement the formula
e−r(T −t)
Z ∞
Re f˜(R + iu)χt (u − iR) du
V (t) =
π 0
Compare your result to those of the explicit Black-Scholes formula using the same parameters.
Useful Python commands: cmath.exp, complex(0,1), .real
that computes the initial price of a bunch of European call options with identical maturity
T and strikes K = (K1 , . . . , Kn ) in the Black-Scholes model via the fast Fourier transform
approach and starting value for the logarithmic strike prices κ1 .
Start by setting the logarithmic strike prices κm according to formula (6.15). And calculate
the corresponding option prices according to (6.16)-(6.18) using the numpy package fft.
Afterwards use the command interp1d from scipy.interpolate or the formula from the
lecture notes to get the option prices for the options with strikes stored in K.
Test your function for
Compare your results to those of the explicit Black-Scholes formula and plot them in a
common graph.
Useful python commands: np.fft.fft, scipy.interpolte.interp1d, complex(0,1), .real
C-Exercise 35 (Pricing European options with MC methods in the Heston model) Bonus
Exercise
Consider a European option with payoff g(S(T )) at maturity T > 0 in the Heston Model
presented in section 3.5 of the lecture notes with parameter r > 0. We want to use the sampled
paths of the variance process from C-Exercise 23 to find the initial option price V (0).
Given a certain path of the sample process for m time steps and ∆t = T /m with values
γ(0), γ(∆t ), γ(2∆T ), γ(3∆t ), . . . , γ((m − 1)∆t ), γ(m∆t ) we can approximate
s !
m m
γ((i − 1)∆t )
S(T ) ≈ S(0) exp ∑ r − ∆t + ∆t ∑ γ((i − 1)∆t )X ,
i=1 2 i=1
V0 = Heston_EuOption_MC(S0, r, gamma, T, g)
that gives you a Monte-Carlo estimate for E [g(S(T ))]. Here gamma is a matrix of the
format created in C-Exercise 23.
(b) Test your function for the European power call option with strike price K = 90, p = 1.2
(i.e. g(x) = (x1.2 − 90)+ ) and the following parameters S(0) = 100, r = 0.05 and T = 1.
For the matrix gamma use a sample from C-Exercise 23 with the parameters given
there.
(c) To get a comparison for your results, modify C-Ex. 32 such that it calculates the value
of the power call (T-Ex. 33) in the Heston model.