All questions please. Both non-programming and programming please.
– Assignment 4 – MATH4090/7049: Computation in financial mathematics Assignment 4 Semester II 2021 Due 5:00pm on Friday October 29 Weight 10% Total marks 45 marks No more question will be added. Submission instructions: Submit onto Blackboard softcopy (i.e. scanned copy) of (i) your assignment, as well as (ii) Matlab code by 5:00pm 29 October 2021. Hardcopies are not required. You also need to upload all Matlab files onto Blackboard. General coding instructions: You are allowed to reuse any code developed in tutorials. An assignment question may have specific programming instructions which you are required to follow. Failure to do so will result in a loss of 50% of the questions’s total marks. For programming questions that require you to submit tables of results, you are not required to write Matlab code to produce the tables. Handwritten tables of results are acceptable. Notation: “Lx.y” refers to [Lecture x, Slide y] Assignment Questions Question 1. (10 marks) Consider the risk-neutral dynamics dvt = a(b− vt)dt+ c √ vtdWt, v0 > 0, (1) where a, b, and c are positive constants.1 (a) (5 marks) Give an ordinary Monte Carlo algorithm to estimate E [ e− ∫ T 0 vtdt ] , where E[·] denotes the expectation operator under the associated risk-neutral measure.2 In your algorithm, use M as the number of sample paths. If a timestepping method is employed, use N as the number of time intervals, with time points tn = n∆t, n = 0, 1, . . . , N , and ∆t = T/N . Make sure that you truncated the simulated v at zero, i.e. if the simulated value v is less than zero, it is then set to zero. Hint: You can use the composite trapezoidal rule:∫ T 0 vtdt ≈ ( 1 2 vt0 + N−1∑ n=1 vtn + 1 2 vtN ) ∆t, ∆t = T/N, tn = n∆t. Here, vt generically denotes an integrand. 1This is the well-known Cox-Ingersoll-Ross model. 2This is the zero coupon bond price at time-0. MATH 4090/7049 – 1 – Duy-Minh Dang 2009-2021 – Assignment 4 – (b) (5 marks) Implementation of the above algorithm. Use the following parameters a = 1.5, b = 0.06, c = 0.7, v0 = 0.1 and T = 0.5. Carry out experiments with sequences of (M,N) {(M0, N0), (2M0, 2N0), . . . , (16M0, 16N0)} and report the Monte Carlo estimates, together with standard errors, and 95% confidence intervals. For this question, you are free to choose M0 and N0 sufficiently large. Typical values are M0 = 10 5 and N0 = 25. 2. (10 marks) Consider a T -maturity basket option that is based on three underlyings whose time-t prices are denoted by S (d) t , d = 1, . . . , 3. The payoff of the option at time T is given by f ( S (1) T , S (2) T , S (3) T ) = ( 3∑ d=1 S (d) T 3 −K )+ , (2) where K > 0 is the strike. Assume that S (d) t , d = 1, . . . , 3. dS (d) t = rS (d) t dt+ σ (d)S (d) t dW (d) t , S (d) 0 > 0 is given. (3) Here, the constant interest rate r = 0.02, and the constant volatilities are σ(1) = 0.3, σ(2) = 0.2, and σ(3) = 0.4. The time-0 prices of the underlying assets are S (1) 0 = 100, S (2) 0 = 110, S (3) 0 = 90. The Brownian motions W (i) and W (j) have correlations ρij , where ρ12 = 0.8, ρ23 = 0.5, and ρ13 = 0.4. We denote by Ct the time t price of this option. a. (5 marks) Present an antithetic Monte Carlo (MC) algorithm to estimate C0. In your al- gorithm, use M as the number of paths for each underlying asset and use Euler timestep- ping with a total of N uniform timesteps. Implement in Matlab the above algorithm. Use the parameters M = 104, N = 100, T = 0.5, and K = 110. Report the antithetic MC estimate ĈavM and the standard error. b. (5 marks) Let GT = (∏3 d=1 S (d) T )1/3 , and consider the “geometric basket” option with payoff given by g ( S (1) T , S (2) T , S (3) T ) = (GT −K)+ . Let CG0 be the time-0 price of a geometric basket option with payoff (GT −K)+. There exists a closed-form expression for CG0 , which is given in the provided Matlab function exact geo basket3(·). (You need to understand correctly how this function works before using it in your code.) Using a geometric basket option as a control variate, implement a control variate MC technique to estimate C0. Use the same parameters as in Part (a). Report Ĉ cv,β̂ M as discussed in class. Report the asymptotically valid standard error σ̂cv,β̂M√ M . 3. (15 marks) In many applications, you need to compute tail probabilities P(X ≥ x) of a ran- dom variable X.3 In this question, to keep things simple, we focus on estimating P(X ≥ x), 3For example, to compute the Value-at-Risk associated with the portfolio, the quantity P(L ≥ l), where L is the loss associated with defaults in a portfolio of bonds over some time period T , needs to be estimated. MATH 4090/7049 – 2 – Duy-Minh Dang 2009-2021 – Assignment 4 – where X ∼ Normal(0, 1), and x is a fixed real constant. We denote by f(u) = e −u 2 2√ 2π and by N (x) = ∫ x −∞ f(u)du the density and the CDF of the standard normal distribution, respec- tively. One way to compute P(X ≥ x) is to use the formula P(X ≥ x) = 1 − N (x). Although it is true in theory, in practice, this formula may/may not work depending on how large x is. As examples, we consider x = 7 and x = 10. Using Matlab, we have (you should also try yourselves) x = 7: N (7) = 0.999999999998720, and hence P(X ≥ 7) = 1.279865102787880× 10−12. x = 10: N (10) = 1, and hence P(X ≥ 10) = 0. This is not a good approximation of P(X ≥ 10), because P(X ≥ 10) ≈ 10−23, and your computer would need to be able to carry the equivalent of at least 23 decimal digits to be able to distinguish N (10) from 1. In this question, we will estimate P(X ≥ x) using importance-sampling Monte Carlo simula- tion. To this end, for a fixed x, we let C(x) = P(X ≥ x), and write it as C(x) = P(X ≥ x) = ∫ ∞ x f(u)du = ∫ ∞ −∞ Ix(u)f(u)du = Ef [Ix(X)] , X ∼ Normal(0, 1), where Ix(u) = 1 if u ≥ x and 0 otherwise, and Ef [·] indicates that the expectation is taken with respect to f .4 As usual, we denote by ĈM (x) and Ĉ is M (x) the ordinary Monte Carlo estimate and its impor- tance sampling counterpart using a total of M samples. Consider the importance-sampling density g(u) = e− (u−x)2 2 √ 2π . Following steps in L6.21, we have the “change of measure” formula C(x) = P(X ≥ x) = Eg [ Ix(Y ) f(Y ) g(Y ) ] , Y ∼ Normal(x, 1), (4) where Eg [·] indicates that the expectation is taken with respect to g. a. (5 marks) Present an importance sampling Monte Carlo algorithm for ĈisM (x) based on the importance-sampling density g(u). In your solution, clearly state what random variables you use and how you would com- pute them if you have a function, such as Matlab’s randn, that returns Normal(0, 1) random variables. Programming requirements: Part (a) is a non-programming question. b. (5 marks) Let x = 7 and M = 106. Implement in Matlab the importance sampling algorithm you proposed in Part (a) for ĈisM (7). Also implement an ordinary Monte Carlo simulation for ĈM (7). Compare MC estimates and the standard errors in these two cases and comments. Sub- mit your output, code and discussions. c. (5 marks) Suppose you want to estimate M such that the ordinary Monte Carlo esti- mate ĈM (x) approximates C(x) to at least two significant digits with a 95% confidence interval. This requirement can be formulated as the condition 1.96 σf (x)√ M ≤ 10−2ĈM (x), (5) 4You can also view Ef [Ix(X)] as the price of a financial contract with a binary payoff Ix(X), where the terminal asset price X ∼ Normal(0, 1), and interest rate is zero, hence no discounting factor. MATH 4090/7049 – 3 – Duy-Minh Dang 2009-2021 – Assignment 4 – where (σf (x)) 2 = Varf [Ix(X)] is the true variance of Ix(X) under f . In practice, we may not know Varf [Ix(X)], so, as discussed in L5, we can use “sample variance” instead. Specifically, we can do as follows. Step 1: do a pilot computation with the number of samples being Mp = 10 3, and obtain sample variance (σ̂f,Mp(x)) 2 and estimate ĈMp(x). Then, in (5), use these values in place of σf (x) and ĈM (x) respectively to estimate how large M should be so that (5) is satisfied. Step 2: carry out the computation with this M and report the Monte Carlo estimate as well as the associated confidence interval at the 95% confidence level. Similar ideas/steps can be used for importance-sampling Monte Carlo estimate ĈisM (x). Let x = 7. Implement the above ideas for ordinary Monte Carlo estimate and importance- sampling Monte Carlo estimate. If the M found in Step 1 is too large to be practical, you do not need to do Step 2, just report the calculated M . Programming requirements for Parts (b)-(c): These parts are programming questions, and you are free to structure your code anyway you want. You can reuse any code developed in the tutorials. Submit your source code, output, and discussions. 4. (10 marks) Continue from Question 3. Let x = 10. We aim to theoretically estimate how effective the importance-sampling technique is in this case. a. (5 marks) Show that5 Varf [I10(X)] = C(10)− C(10)2. Use this result to estimate how large M should be such that ĈM (10) approximates C(10) to at least two significant digits with a 95% confidence