CompFin 2020 SS QF Sheet 11

You might also like

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

Christian-Albrechts-Universität zu Kiel SS 2020

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

V0 = BS_EuCall_Laplace (S0, r, sigma, T, K, R)

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

from the course.


Test your function for

S0=100, r=0.05, sigma=0.2, T=1, K=100, R=1.1.

Compare your result to those of the explicit Black-Scholes formula using the same parameters.
Useful Python commands: cmath.exp, complex(0,1), .real

T-Exercise 33 (Power call)


The power call with strike K and power p ≥ 1 is an option with payoff (S(T ) p − K)+ at
maturity T . If one wants to price this option with integral transform methods we need the
Laplace transform of the function f (x) = (exp(x) p − K)+ . Calculate the Laplace transform
fe(z) of this function and denote for which z ∈ C this holds.
C-Exercise 34 (Option pricing via fast Fourier transform) Bonus Exercise
Write a python function

V0 = BS_EuCall_FFT (S0, r, sigma, T, K, R, N, M, kappa1)

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

S0=100, r=0.05, sigma=0.2, T=1, K=(80,81,...,180), R=1.1, N=2ˆ11,


M=50, kappa1=log(80).

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

where X is a N (0, 1) distributed random variable.

(a) Implement this approximation by writing a function

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.

(d) Explain why the approximation for S(T ) makes sense.


Please comment your solution. Please include your name(s) as comment in the beginning
of the file.

Submit until: Thu, 02.07.2020, 8:30

You might also like