MTH 600: Assignment 2: Due March. 19 (Thursday), in Lab
MTH 600: Assignment 2: Due March. 19 (Thursday), in Lab
MTH 600: Assignment 2: Due March. 19 (Thursday), in Lab
Winter 2020
IMPORTANT: A detailed report that contains all relevant parts of the solutions (explanations,
graphs, etc.) and includes documented MATLAB scripts (within the document). Most of the marks
for programming questions are allocated for explanations of algorithms and discussions of results.
If all you hand in is the listing of the “Raw Code” or “Raw Output” by itself, you will get poor
marks. All coding should be done in Matlab (nicely commented). The TA will take off marks
for poor documentation. Penalty for late submission is 10 marks per day (i.e., you will receive
maximum 90 if you submit your assignment on March 19).
Assignment Questions
S = [0:0.1*K:0.4*K,...
0.45*K:0.05*K:0.8*K,...
0.82*K:0.02*K:0.9*K,...
0.91*K:0.01*K:1.1*K,...
1.12*K:0.02*K:1.2*K,...
1.25*K:.05*K:1.6*K,...
1.7*K:0.1*K:2*K,...
2.2*K, 2.4*K, 2.8*K,...
3.6*K, 5*K, 7.5*K, 10*K];
1
Table 1: Data for Put Example
σ .4
r .02
Time to expiry (T ) 1.0 years
Strike Price $100
Initial asset price S 0 $100
Let
h = C1 · ∆S
h = C2 · ∆t
Suppose we label each computation in the above sequence by a set of h values. Then the
solution on each grid (at a given point) has the form
V (h) = Vexact + A · h2
V (h/2) = Vexact + A · (h/2)2
V (h/4) = Vexact + A · (h/4)2 (2)
where we have assumed that the mesh size and timestep are small enough that the coefficient
A in equation (2) is approximately constant. Now, equation (2) implies that
V (h) − V (h/2)
'4 (3)
V (h/2) − V (h/4)
Check the theory by examining the rate of convergence of your pricer.
Carry out the above tests using fully implicit, and Crank Nicolson method. Show a conver-
gence table for each test.
d). Show plots of the option value for the range S = [50, 150], for your solution on the finest
grid for CN method.
Submit your matlab code.
2. (20 marks) Heat Deduction Equation
Consider the following PDE from the heat deduction problem
ut = uxx ,
u(t, 0) = 0, u(t, 1) = 0,
2
u(0, x) = −x + x.
2
a). Provide the algorithm (in pseudo-code) for solving the PDE by the Crank-Niclson method.
b). Implement the algorithm into Matlab code and plot u(t, x) on the grid of (t = [0, 1] ×
[0, 1] = x) with M = N = 50 in constant steps.
Submit your Matlab Code.