关键词 > MATH4090/7049
MATH4090/7049: Computation in financial mathematics Practical 2
发布时间:2022-08-16
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
MATH4090/7049: Computation in financial mathematics
Practical 2
Semester II
Notation: “Lx.y”refers to [Lecture x, Slide y]
1. Recall Algorithm 1 for European options in L1.
(a) Modify this algorithm to price a continuously monitored up-and-out barrier put option with the barrier H > S(0).
(b) Modify this algorithm to price an American put option.
2. In this question, you are asked to modify the code you developed in Practical 1 (for European options) to price a continuously monitored up-and-out barrier options with the barrier H > S(0).
You can choose either tree slow .m or tree fast .m from Practical 1, then save the file under the name barrier tree .m.
Download the file test barrier tree .m from Blackboard into the same directory.
Then modify the code in barrier tree .m to enforce the barrier constraint at each tn , n = 1, . . . ,N (note continuous monitoring), which will be called by the code in test barrier tree .m, such that test barrier tree .m runs properly and outputs“barrier tree.m passed”.
In modifying barrier tree .m, use the following steps
(a) Modify barrier tree .m to accept the barrier H as the last input argument. (b) Identify in the code where you need to enforce the barrier constraints (only two places).
(c) Modify and insert the following piece of code into these places:
%compute the option prices at time t_n;
%loop over all possible S levels
%at time t_n
%instruction: replace xxx with the correct number for j=0:xxx
%instruction: compute the level- j
% stock value at time t_n
S = ;
%instruction: complete the barrier constraint and
% the expectation formula
if(S >= )
W(j) = ;
else
W(j) = ;
end
end
You only need to use the else branch in one place.
(The above piece of code is not efficient, i.e. it can be vectorized to gain more speed.)
3. Continue Question 2. There exists a closed-form solution for a continuously monitored up-and-out barrier option, given in Hull (2006)[Chapter 22.6, See supplementary document]
C0(0) ≡ Cup-and-out = CBS − Cup-and-in ,
where
Cup-and-in = S0N(x1 ) − Ke −rT N(x1 − σ ^T) − S0(H/S0 )(2λ) (N (−y) − N (−y1 )) + Ke −rT (H/S0 )(2λ −2) (N (−y + σ ^T)− N (−y1 + σ ^T)) ,
where
r + σ2 /2
2
ln (H2/(S0K))
y1 = + λσ ^T,
x1 = + λσ ^T,
N(x) = \0t e −t2 /2dt .
Code this up, the same way you coded myblsprice .m in Practical 1, and compare your tree results for N = {100, 200, 400, 800} with the exact solution.
4. On L1.24, it is shown that the price of an American call written on a non-paying dividend stock is always strictly more than the exercise price, and hence it is never optimal to exercise early an American call. In this question, you are asked to show this result on a (no-arbitrage) binomial tree.
Let Cn(j) be the value at node (n,j) of an American call option with strike K and maturity T obtained using the algorithm discussed in Lecture 1, n ≤ N, −n ≤ j ≤ n.
Cn(j) > Sn(j) − K, n ≤ N − 1 and − n ≤ j ≤ n. (1)
Hint: Note that max(a,b) ≥ a and max(a,b) ≥ b
What does (1) imply for an American call on a non-dividend-paying stock? Explain.