MATLAB代写-COMP0043

University College London
COMP0043 Numerical Methods for Finance
Dr Guido Germano
Coursework 2, due 11 January 2020
1. Split the script bs.m into a main and three functions for each of its three sections:
analytical Black-Scholes-Merton, Fourier transform and Monte Carlo. To speed up
the tests, comment out the code that produces the figures 1–4 in bs.m and the code
that produces the figure at the end of payoff.m, which is called twice. (10 marks)
If you prefer, you may rewrite everything in another programming language that you
like better, for instance Go, https://golang.org, developped since 2007 by Google
and increasingly deployed there, or Julia, https://julialang.org, developped since
2011 at MIT and used since 2014 by Blackrock, the world’s largest asset mana-
ger, for its next-generation analytics platform: https://juliacomputing.com/case-
studies/blackrock.
2. Add to geometric Brownian motion, as a jump component, a normal compound
Poisson process; the result is a Merton jump-diffusion process, whose Monte Carlo
simulation we have seen in the script mjd.m. For the diffusion part use the same
parameters as in bs.m, i.e. σ = 0.4; for the jump part use the same parameters as
in mjd.m, i.e. λ = 0.5, µJ = 0.1, σJ = 0.15.
(a) Pricing with the Fourier transform: add a term λ(eiµJξ−
1
2
(σJξ)
2 − 1) (Ballotta
and Fusai 2018, Table 6.4, page 182) to the characteristic exponent ψ(ξ) and
a corresponding constant to the drift parameter µRN in order to obtain the
risk-neutral measure. For a call, use the damping parameter α = −1. (20
marks)
(b) Pricing with Monte Carlo: add a few lines of code inside the for loop over
blocks adapting it from mjd.m. Like for arithmetic Brownian motion, you can
do a single step from 0 to T . In order to perform the simulation with the
risk-neutral measure, use the same corrected drift parameter µRN as for the
Fourier transform method. (20 marks)
Alternatively, instead than to MJD you may extend geometric Brownian motion
to the Kou process. The extra term in the characteristic exponent is λ
(
p η1
η1−iξ
+(1− p) η2
η2+iξ
− 1) (Ballotta and Fusai 2018, Table 6.5, page 185). Use the random
number generator for the jumps in kou.m, the same parameters as in kou.m, i.e.
λ = 0.5, p = 0.4, η1 = 4, η2 = 3, and the damping parameter α = −1 for a call.
The first three to five digits of the FT and MC prices should agree and be slightly
higher than the Black-Scholes price because the jump process increases the volatility.
3. The price of an option is the discounted expected value of its payoff, and thanks to
the Plancherel theorem it can be computed also in Fourier space,
V (X, 0) = e−rTE
[
g(X(T ))e−αX(T )
]
= e−rT
∫ +∞
−∞
g(x)e−αxfX(x, T )dx
=
e−rT
2pi
∫ +∞
−∞
ĝ(ξ)ϕ∗X(ξ + iα, T )dξ,
where X(t) = log(S(t)/S0) is the log-price, T is maturity, g(x) is the payoff damped
by the factor eαx, and ϕX(ξ, T ) = f̂X(ξ, T ) is the characteristic function (see page
14 of the lecture notes on pricing with Fourier transform methods).
Extend bs.m as modified in the previous two questions to show the following.
(a) As the price V is a real number, it does not change taking its complex conjugate
and thus if the integrand in Fourier space is ĝ∗(ξ)ϕX(ξ + iα, T ). (10 marks)
(b) Currently the integration in Fourier space is overengineered by taking the
zero-frequency value of an FFT. Using the trapezoidal integration rule (see
Assignment 1) yields the same result. (10 marks)
(c) Even a simple sum (see again Assignment 1) yields the same result. (10 marks)
(d) Add a figure that plots the one-time PDF fX(x, T ) at maturity computed (i)
with Monte Carlo and (ii) with an inverse FFT of the characteristic function.
To keep things simple, you may use just the data from the last Monte Carlo
block. (10 marks)
(e) Do the integral in log-price space using the payoff g(x)e−θαx = max(θ(S0ex −
K), 0) and the one-time PDF fX(x, T ) obtained in part (ii) of the previous
subquestion from an inverse FFT of the characteristic function (the accuracy
may be lower). (10 marks) 