程序代写代做代考 C algorithm Due 5:00pm on Friday October 30

Due 5:00pm on Friday October 30
Total marks Final Version
Weight 10% 45 marks
– Assignment 4 –
MATH4090/7049: Computation in financial mathematics Assignment 4
Semester II 2020
Submission instructions:
􏰎 Submit onto Blackboard softcopy (i.e. scanned copy) of (i) your assignment, as well as (ii)
Matlab code by 5:00pm on Friday October 30 2020. Hardcopies are not required.
􏰎 You also need to upload all Matlab files onto Blackboard.
General coding instructions:
􏰎 You are allowed to reuse code developed in practicals.
􏰎 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 total marks for that questions.
Notation: “Lx.y” refers to [Lecture x, Slide y]
Assignment Questions 1. (5 marks) Consider the dynamics
dxt = μ(xt, t)dt + σ(xt, t)dWt, x0 : given, where μ(xt, t) and σ(xt, t) are given deterministic functions of xt and t.
Give an ordinary Monte Carlo algorithm (not Matlab) to approximate
0
􏰑􏰀􏰕 T 2 􏰁+􏰒 (xt) dt−K
,
where E[·] is an expectation operator, and K > 0 (You can view E 0 (xt) dt − K + as
E
􏰈􏰄􏰓T 2 􏰅􏰉 the price of a financial instrument named “X” whose details do not concern us.)
In your algorithm, use M as the number of samples and 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.
Hint: You can use the composite trapezoidal rule
􏰕T 􏰀1N−1 1􏰁
vtdt≈ 2vt0 +􏰔vtn +2vtN ∆t, ∆t=T/N,tn =n∆t.
0 n=1 Here, vt generically denotes an integrand.
MATH 4090/7049 – 1 – Duy-Minh Dang 2009-2020

– Assignment 4 –
2. (15 marks) Under risk-neutral probabilities, assume that the price S of a barrel of crude oil satisfies
St = exp(Xt),
dXt = κ(α − Xt)dt + σdWt,
where κ, α, and σ are positive constant. Let r be the constant interest rate, and 0 < T1 < T2 be two maturities. We denote by Ft, 0 ≤ t ≤ T2, the time-t forward price of one barrel of crude oil for T2-delivery. It can be shown that, for 0 ≤ t ≤ T2, 􏰏 −κ(T2−t) 􏰄 −κ(T2−t)􏰅 σ2 −2κ(T2−t) 􏰐 Ft=Et(ST2)=exp e lnSt+ 1−e α+4κ(1−e ) . (1) You do not need to prove (1). Let C(S0,t0) be the time-0 price of a T1-expiry and K1-strike European call option on a T2-maturity crude oil forward price. In other words, this call pays (FT1 − K1)+, where Ft is given in (1). (a) (5 marks) Describe an ordinary Monte Carlo algorithm for approximating C(S0,t0). In your algorithm, use M as the number of samples, and if a timestepping method is employed, use N as the number of uniform time intervals. Programming requirements: This part is a non-programming question. You only need to submit a hand-written pricing algorithm. Do not give Matlab code as it will not be marked. (b) (5 marks) Suppose κ = 0.472, α = 2.782, σ = 0.368, and r = 0.05. The time-0 spot price is S0 = 26.9. The option has strike K1 = 23.2 and expiration T1 = 0.5. The forward matures at T2 = 1. Implement the algorithm you proposed in Part (a) to estimate C(S0,t0). If a timestep- ping method is used, use a total of 100 uniform timesteps. Choose the number of samples M large enough that the standard error [the sample standard deviation, divided by the square root of the number of trials] is less than 0.05. Report the standard error. Don’t use any variance reduction technique. Programming requirements for Part (b): This part is a programming question with the following instructions. 􏰎 Name your main script crude oil.m. Submit the scrip file and any of Matlab functions that you write, together with your output, observations and comments (if any). (c) (5 marks) Delta (∂C/∂S) and Gamma ∂2C/∂S2 of an option are important in risk- management. Estimate ∂C/∂S by using Monte Carlo simulation to calculate (C(S0+0.001)−C(S0))/0.001. For the C (S0 + 0.001) calculation, reuse the same normal random variables that you gen- erated for the C(S0) calculation. Use the same number of paths as in Part (b). Describe how you would estimate ∂2C/∂S2 using Monte Carlo simulation? Implement your ideas in Matlab. Programming requirements for Part (c): This part is a programming question. Name your main script crude oil greeks.m. Submit the scrip file and any of Matlab functions that you write, together with your output, observations and comments (if any). MATH 4090/7049 – 2 – Duy-Minh Dang 2009-2020 – Assignment 4 – 3. (10 marks) Suppose we want to use Monte Carlo, with a control variate, to price the European put with strike K and expiry T under the (risk-neutral) CEV dynamics dSt = rStdt + σStαdWt (2) wherer>0,σ>0,andα>0aregivenconstants. TheStα denotesSt tothepowerα.
Time-0 spot is S0 also given.
As a control variate, use e−rT (K − ST∗ )+, where
dSt∗=rSt∗dt+σ∗St∗dWt, S0∗=S0,
where W is the same Brownian motion that drives S, and σ∗ is a constant, which we will
choose to approximate the CEV dynamics, by letting it be the solution to σ ∗ S 0 = σ S 0α .
Implement the above control variate Monte Carlo technique when S0 = 100, K = 95, expiry T =0.25,r=0.05,σ=3,andα=0.5.
Requirements:
􏰎 Let the number of timesteps be N and the number of sample paths be M. For the SDE
(2), denote the simulated asset price by Sˆ(m), m = 1,…,M, n = 1,…N. n
􏰎 To simulate the SDE (2), using the usual Euler timestepping method with N = 250 time steps, and M = 5000 samples paths.
If the simulated asset price Sˆ(m), m = 1,…,M, n = 1,…N, ever goes negative, replace n
it by zero before proceeding to the next time step.
􏰎 For the control variate, denote by S∗,(m), m = 1,…,M, the simulated price of the
control variate at maturity. You will need to simulate S ∗,(m) , m = 1, . . . , M ; however, in T
each simulation of S ∗,(m) , m = 1, . . . , M , you should reuse the N normal random draws T
that generated the corresponding S(m) path.
To get full credit, you should not simulate S∗,(m), n = 1,…N, i.e. at intermediate times,
but rather, you should directly simulate the final price S∗,(m), using the N normal T
random draws for the m-th path, in a way that produces the correct distribution of S ∗,(m) .
T
􏰎 Report (i) your option price estimate variate Cˆcv,βˆ as discussed in L6.14-15, (ii) your M
estimated optimal variate coefficient βˆ, and (iii) your asymptotically valid standard error σˆ cv,βˆ
T
M as in L6.16. M
In addition, report the respective information for an ordinary (without CV) Monte-Carlo estimate.
􏰎 Programming requirements for Part (c): This part is a programming question. Name your main script cev.m. Submit the scrip file and any of Matlab functions that you
write, together with your output, observations and comments (if any).

n
MATH 4090/7049 – 3 – Duy-Minh Dang 2009-2020

– Assignment 4 –
4. (15 marks) Recall the Black-Scholes model under the risk-neutral probability measure. In particular, let the bank account and non-dividend paying stock satisfy
dBt = rBtdt, B0 = 1, dSt = rStdt + σStdWt, S0 > 0,
where σ > 0 and W is a P-Brownian motion.
Let fST (s) for s ∈ (0, ∞) denote the (lognormal) density function of ST .
Consider a K-strike T-expiry vanilla call option, and let C denote its time-0 price.
(a). (1 mark) As discussed in class, for the purpose of estimating C by Monte-Carlo, there exists an optimal importance sampling density for ST , which would yield a price estimate with zero variance. Let us call this optimal density gST (s). Write down a formula for gST (s). Your formula may contain integral(s). Your formula may contain fST .
(b). (2 marks) Find a formula for the expectation of ST with respect to the density gST . Simplify the formula so that it does not contain integral(s), and does not contain fST or gST . It may contain the standard normal CDF N(·), and/or the function CBS(·).
In Part (c), you may use S ̄ to denote your part (b) answer.
(c). (3 marks) Suppose that we sample from a new probability measure P∗, under which W now has constant drift λ instead of drift 0. Thus Wt = Wt∗ + λt where W∗ is a standard P∗-BM.
No matter how λ is chosen, it will be impossible for a drift-change of this form to induce exactly the optimal distribution of ST that you computed in (a). However, the drift-change can be chosen such that the distribution of ST under P∗ approximates the optimal distribution specified by gST . One way is to choose λ such that the expectation of ST under P∗ matches the expectation of ST under density gST . (We can’t make the distributions agree, but at least we can make their expectations agree.)
What choice of λ accomplishes this?
(d). (3 marks) Describe an importance sampling Monte-Carlo using the drift adjustment
from Part (c) to estimate C.
(e). (6 marks) Let S0 = 100, σ = 0.1, r = 0.01, K = 150, T = 1.
Code in Matlab using 105 ordinary Monte-Carlo replications to estimate C. Report a standard error.
Implement in Matlab your importance sampling Monte Carlo algorithm in Part (d). Use 105 importance sampling Monte-Carlo replications. Report a standard error. Be aware that your zero-mean normal random draws, here, simulate increments of W ∗ not W . Each replication should require only one number to be generated by randn.
Comment: of course, we do not need Monte-Carlo to price an European call option under the Black-Scholes. However, suppose you wanted to price a deep OTM option under an intractable (stochastic volatility) model, using importance sampling. You could still use the same formula in Part (c) to provide some guidance regarding how to choose λ. That formula does depend on a parameter σ; in place of σ, we could, for example, substitute the long- term level to which the stochastic volatility reverts. Of course (unlike in the GBM case) the resulting λ would not be exactly optimal under stochastic volatility, but at least we have a reasonable first approximation. (Moreover, even if λ is badly chosen, the importance sampling estimate is still unbiased.)
MATH 4090/7049 – 4 – Duy-Minh Dang 2009-2020

– Assignment 4 –
Programming requirements for Question 4:
􏰎 Parts (a)-(d) are non-programming. In Part (d), do not give Matlab code as it will not be marked.
􏰎 Part (e) is a programming question. Name your main script driftChange.m. Submit the scrip file and any of Matlab functions that you write, together with your output,
observations and comments (if any).
MATH 4090/7049 – 5 – Duy-Minh Dang 2009-2020