7CCMFM06 Coursework 2020/21
John Armstrong
December 14, 2020
General Coursework Instructions
For your coursework you should submit four documents via Keats:
1. A pdf write-up of your coursework. This must be generated using LaTeX.
It should contain a mathematical description of how you answered the
question, together with any plots you have generated and the interpreta-
tion of your results. You should focus on the mathematics used rather
than the details of how it was implemented in Python. For example, you
should explicitly state any difference equations used in your calculations.
You should divide your write-up into sections corresponding to the differ-
ent parts of the question.
2. A Jupyter notebook containing the Python code that calculates any nu-
merical values used in your write-up. This notebook must run on CoCalc
without requiring any additional files or libraries.
options on the File menu in the Jupyter notebook.
4. A signed departmental coversheet indicating that this is all your own work.
The pdf file of your coursework should be generated with the default LaTeX
fonts and margins and must not exceed 10 pages. You should not see 10 pages
as a target: if you can express yourself concisely you should do so. You will be
given credit for concise and interesting writing and will lose marks for long and
uninteresting writing and for including irrelevant details.
Be sure to reference all of your sources.
You may discuss the problem with other students but must not share any of
your code or written work with other students.
Specific Question for Shengkai Wang - Corrected
Version
1. You must show how to price a specific knock-out derivative on a stock.
1
The stock price process St for times t ∈ [0, T ] is known to follow the
stochastic differential equation
dSt = St(µdt+ σ(t) dWt)
where Wt is a Brownian motion, S0 = 270.0000, µ = 0.0900 and
σ(t) = 0.16× (1.6667× t)1.5.
A trader may also invest in a risk-free bank account that grows at the
continuously compounded rate r = 0.0425. The units of time for this
question are years and all prices are in dollars.
The contract of this derivative is defined as follows. If the stock ever hits
the barrier level B = 303.0000 on or before the maturity T = 1.0000 of
the option then the payoff of the derivative will be 0. Otherwise the payoff
of the option will be f(ST ) where ST is the stock price at maturity and
the function f is defined by
f(ST ) = max{(0.0033× ST )1.5 × ST − 185, 0}.
You should price this option using the Crank-Nicolson finite difference
method and may assume that the price V (t, S) satisfies the partial differ-
ential equation
∂V
∂t
+
1
2
σ(t)2S2
∂2V
∂S2
+ rS
∂V
∂S
− rV = 0
with boundary condition V (t, B) = 0, plus additional boundary conditions
you should identify. You should use the Crank-Nicolson finite difference
method with a uniform grid containing 1001 time points and 1001 stock
price values. x
Record the price of the derivative at time 0 and the delta of the derivative
at time 0 in the table of results at the end of your essay. [20%]
2. Suppose that a trader attempts to replicate this option using a discrete-
time version of the delta-hedging trading strategy, rehedging at the same
time-points you used when implementing the finite difference method. The
trader uses the value for the price and the value of delta computed by the
finite difference method, using linear interpolation to calculate values at
points which are not in the grid.
Calculate an SDE satisfied by Zt = logSt and simulate Zt using the
Euler scheme for this SDE using the same time points as above. Using
the stock prices arising from this simulation, perform 1000 simulations of
the trader’s strategy and plot a histogram of the error in this replication
strategy. You should compute the 25th and 75th percentiles of the error
and record these values in the table at the end of your essay.[20%]
2
3. Interpret your results. This means that you should make some financially
relevant observations based on your simulation, plotting charts you find
interesting. In order to make interesting observations you might want to
run variations on the simulation, for example varying the barrier. Please
remember to edit your findings and to only comment on the most inter-
esting points. [15%]
4. Describe how you have tested your code is correct, for example explaining
how you have checked that you have priced the derivative correctly. [15%]
5. You must finish your coursework by completing the following table of
results:
Price
Delta
25th percentile
75th percentile
The remaining 10% of your marks will be allocated based on the quality of
3 