CS 335 - Winter 2022: Assignment 2
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
CS 335 - Winter 2022: Assignment 2
1. (9 marks) Binomial lattice pricing.
Consider a binomial lattice with 2 time steps for an underlying asset price S and the corre- sponding lattice for the option value V as shown in the figure below. Assume the risk-free rate of interest, r = 0%.
2(2) = ? |
1(1) = 2.4 |
1(2) = 2 |
0(1) = ? |
0(2) = ? |
Complete the lattices of S and V . In addition, compute the delta parameters at the three positions as indicated on the lattice. Explain all your answers.
2. (15 marks) Option pricing using a binomial no-arbitrage lattice.
Develop Jupyter/Python code for pricing European and American options, for both calls and puts, using a binomial no-arbitrage lattice. Use the lattice parameters as described for example in Section 3.2 of the course notes and in lectures. (For this question, you do not need to apply smoothing of the payoff.)
Your code should be vectorized so that there is only one explicit for loop over the time steps. However, you are allowed to use an outer loop to go through different values of ∆t (or N). See Section 3.5 of the course notes for hints on how to proceed. Also, your code should take only O(N) storage, NOT O(N2). Thus, do not store data for the whole tree at once, but rather store data for one or two columns at a time. In the American case, note that you should compute the payoff (and hence the stock prices) at each time step using vector operations.
Test your code for European put and call options by using the data in Table 1. Compare with the exact analytical solution values given by the function blsprice provided with the assignment. (blsprice is designed to mimic the MATLAB function of the same name, so you can find details on it here: https://www.mathworks.com/help/finance/blsprice.html)
Create 2 tables (1 for calls and 1 for puts) that show the option value V∆t(S0(0) , 0) as a function of ∆t. Start off with ∆t = T/50, and then repeat the process to compute the option value for ∆t/2, ∆t/4, . . . , ∆t/128. (Thus the number of time steps increases from 50 to 6400.) You should expect to see your results converging to the exact solution value. Format your tables similar to Table 2 (no need to create borders; just rows of text is fine). Your table should also show the exact blsprice value for comparison.
σ r Time to expiry Strike price K Initial asset price S0(0) |
0.25 0.03 1 year $100 $100 |
Table 1: Some typical option parameters
∆t |
Value |
Change |
Ratio |
T/500 T/1000 T/2000
|
V∆t1 V∆t2 V∆t3 |
V∆t2 − V∆t1 V∆t3 − V∆t2
|
V∆t2 -V∆t 1 V∆t3 -V∆t2
|
blsprice |
V |
|
Table 2: Convergence Test
Let Vexact be the exact price and Vtree be the price obtained from a binomial lattice. It can be shown that
Vee(S, t) = Vexact(S, t) + C(S, t)∆t + O((∆t)2 ),
where C(S, t) is independent of ∆t. Estimate (by hand calculation using the above formula)
V/(e)2(e)(S0(0) , 0) − Vee (S0(0) , 0)
∆t二0 V(S0(0) , 0) − V(S0(0) , 0) .
What order of accuracy does the convergence data table you generated indicate our lattice method is likely exhibiting? Does this agree with the theory above?
Next, repeat the above tests for an American put (no analytic solution available), using the data
in Table 1. Show a convergence table as in Table 2 (but without blsprice).
3. (9 marks) Smoothing lattice payoffs.
The payoff of a (bull) call spread option is given by
Payoff = max(S − K1 , 0) − max(S − K2 , 0),
where K1 and K2 are strikes and K1 < K2 .
(a) (2 marks) Modify your code in question 2 and repeat the convergence test (i.e. generate a convergent table) for a European call spread option defined above. Use the same data as in Table 1 except the initial stock price is now set to S0(0) = $92. Also, let K1 = $100, K2 = $130. Do not apply any smoothing. What do you observe?
(b) (3 marks) Derive a smoothed payoff for the call spread option as defined above, using a similar technique as for the put option shown in class. You should express your answer similar to the smoothed payoff of the put and call option examples on page 38 of the course notes.
(c) (4 marks) Now repeat the convergence test again using the smoothed payoff in part (b). You do not need to vectorize the payoff-smoothing component of your code. Note that you will only need to smooth the payoff at the final time, t = T (i.e. at the very beginning of your time stepping). Thus the main loop of your algorithm should not need to change at all, and so no payoff smoothing needs to be applied at times t < T. Generate a convergence table for a European call spread option. What do you observe?
(The course notes include an example (Tables 3.3.3 and 3.4.1) of a European put option which shows the different convergence behaviour with and without smoothing of the payoff. The tables will give you an idea of what to expect.)
4. (6 marks) Lattice properties.
Let Vtree (Sj(n), K1 , K2 , tn ) be the solution from a binomial tree (lattice) pricer, for an European butterfly with constant volatility σ, risk free interest rate r and strikes K1, K2. Assume that the parameters u, d, p* are given, with risk neutral probability 0 < p* < 1. Let the expiry time T = N∆t. Assume that the payoff is
Vtree(Sj(N), K1 , K2 , T) = max(K1 − Sj(N) , 0) − 2 max(Sj(N) − , 0) + max(Sj(N) − K2 , 0),
j = 0, 1, . . . , N. Prove that, if λ > 0 is a constant, then
Vtree(λSj(n), λK1 , λK2 , tn ) = λVtree(Sj(n), K1 , K2 , tn ),
j = 0, . . . , n and n = 0, . . . , N − 1.
(Hint: use induction. Note that the algorithm proceeds backwards from N → 0, so that the base case is n = N.)
5. (8 marks) Dynamic Programming.
Consider the following game. You are given a fair five sided die, with faces {−1, 0, 1, 2, 3}. You can roll the die, and obtain a payoff equal to the value shown on the die, or you can choose to roll again. Note that if you choose to roll again, you can only get the new payoff or roll again. You can roll the die up to three times. Each time you roll the die (including the first roll), you must pay $0.20. What is your expected gain, assuming you follow the optimal strategy? (Hint: this is an American option type problem. Use dynamic programming; i.e. work backwards from the last possible roll.)
Note: Do not write any code to solve this problem. This is a pencil and paper exercise.
2022-02-07