计算机代考 Due: 4pm Mar 17, 2022

Due: 4pm Mar 17, 2022
Programming Questions
IMPORTANT: In this and in future assignments, most of the marks for programming questions are allocated for explanations of algorithms (e.g. pseudo-code) and discussion 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. All the plots should be appropriately labeled. You should submit all Matlab code used in your assignment. Be sure to document (i.e. add liberal comments) your code. The TA will take off marks for poor documentation.
1 [(10 marks) ] (Numerical Scheme for SDE)

Copyright By PowCoder代写 加微信 powcoder

Assume that the interest rate rt is modeled by the mean-reverting process below
drt = a(b − rt)dt + σ√rtdZt
where Zt is a stabdard Brownian motion, and a, b, σ are positive constants.
Let the time step ∆t be given. Assume that the interest rate rn at time tn = n∆t is given.
(a) Given rn at tn, write down the Euler-Maruyama formula for computing the interest rate rn+1 at tn+1. Assuming rn = b, write down the condition on the standard normal sample which leads to rn+1 < 0. Explain. (b) Given rn at tn, write down the Milstein method for computing rn+1. Assumming rn = 0, provide an inequality using parameters a, b, σ, which guarantees that rn+1 is always positive. 2 [ (8 marks) ] (Numerical Scheme for SDE) For a long time horizon, the following risk neutral CIR interest rate model can be considered drt = a(b−rt) dt+σ√rt dZt where a,b,σ are positive constants, representing speed of mean reverting, average rate and volatility respectively. A zero coupon bond, paying off one dollar at t = T , has the following no-arbitrage value BondValue = EQexp − r(t)dt . (1) Provide a pseudo code for using a Monte Carlo method with M simulations, N time steps, and Milstein time-stepping to price the above zero coupon bond. Determine the value at t = t0, assuming r = r0 at t = t0 . Assume the existence of a function which returns a random variable φ ∼ N (0, 1). . Table 1: Data for Hedging Simulations Using a Binomial Lattice Time to expiry T Initial asset price S(t0) Strike Price K 1 year $10 $0.95S(t0) 250 3 [(20 marks) ](Compute Delta from a Binomial Lattice) Assume that the (no dividend) underlying price follows dSt =μdt+σdZt (2) St where Zt is a standard Brownian, μ and σ are constants. Consider the European straddle, whose payoff equals the sum of the call payoff and put payoff with the same strike K, i.e., max(S − K, 0) + max(K − S, 0). You are to conduct hedging effectiveness analysis for this power option using MC simulations of (2) for the underlying price so that there is no time discretization error in the simulated price. In addition, you will compute hedging positions by modifying your code for option pricing under a binomial lattice in Assignment 2. Assume that the initial option price is computed from your binomial model. Specifically, (a) Write a Matlab function [V0,S,δ] = binomialDeltaStraddle(S0,r,σ,T,N) which returns, the initial option value V0, S and δ, representing the underlying price and delta hedging positions on the binomial lattice nodes over equally spaced N time periods in [0,T]. The interest rate r and volatility σ are constants. (b) Now consider a vector of (simulated) underlying price S (not necessarily equal to any binomial lattice price), using linear interpolation to determine the corresponding hedging positions δ(S) from the binomial lattice price vector Sn and delta δn as follows: When a simulated price in S does not equal to any lattice price Sn, interpolate using the hedging values at lattice nodes at each rebalancing time to approximate the hedging position (you can use matlab function interp1). To avoid potentially large extrapolation error, reset the hedging position equal to that of the nearest binomial price S n , if an underlying price exceeds the range of the price S n . Write a Matlab function δ=interpDelta(δn, Sn, S) to implement this interpolation. (c) Using the data in Table 1, binomialDeltaStraddle, and interpDelta, write a matlab script to compute hedging positions at time tn, n = 0.8N, for a European straddle S = linspace(0.8S0, 1.4S0, 100) and plot the computed hedge position δ against S. (d) Using the parameter values given in Table 1, determine the hedging error using discrete delta hedging for the straddle. Plot the histogram of the relative hedging error P&L, for no hedging, n=1:1:N (daily),n=5:5:N (weekly), n=20:20:N (monthly)respectively. assuming hedging positions are computed using binomialDeltaStraddle and interpDelta,. The Matlab functions histc, bar might prove useful. Use at least 50 bins in your histogram. Comment on your observations. (e) Write a Matlab function [var,cvar]=dVaRCVaR(P&L, β) which returns VaR and CVaR for a discrete P&L distribution with M independent samples using the procedure described. In Matlab, ordering can be done using sort. For the straddle, compute and report in a table, mean, standard deviation, VAR (95%), CVAR (95%), of P&L for no hedging, rebalancing monthly, weekly, and daily. Discuss how hedging performance changes with the rebalancing frequency. (f) In general, a hedging rebalancing time trb may not coincide with the discrete time t of the lattice. nn How would you change your code to implement the hedging analysis? 4 [(10 marks)] (Trading simulation) You think you have discovered an arbitrage dynamic trading strategy. Does it work? Simulation can be used to analyze your strategy. Assume that it is possible to trade continuously in time, without transaction cost, and you can short sell stock, i.e., borrow stock to sell and return later without cost. For simplicity, assume that the interest r = 0. Let St and Pt denote time t values of the stock and a European put with strike K and expiry T. Suppose that today you sell the European put option with strike K and expiry T. Assume S0 < K. Let δtSt + Bt denote the value of the portfolio of the underlying and cash account at t. The cash account Bt is used to balance the transactions. At t = 0, you sell a share in the stock, i.e., δ0 = −1. Subsequently, for t > 0, you implement the following simple hypothetic trading strategy: As soon as St > K, buy a stock share. As soon as St < K, you sell the stock. Att=0,thecashaccountissetsuchthat−P0+δ0S0+B0 =0. (a) Write down a mathematical expression for your trading strategy δt, 0 < t < T, where δt denotes the number of shares in the stock immediately after trading at t. (b) Under specified assumptions, time t value of the hedging portfolio δtSt + Bt has two differential expressions in terms of St,K. Provide the precise expressions and conditions under which each expression is valid. Explain. (c) Show that this is an arbitrage by analyze the distribution for the relative P&L, (−PT + δT ST + BT )/(P0 + S0). (d) Now perform the following computation to investigate whether this is true. Assume that the underlying follows a Black-Scholes model, with the model parameters given in Table 1. Simulate your strategy above, assuming S0 = 100, K = 105. Compute the relative P&L (−PT + δT ST + BT )/(P0 + S0) by MC simulations. Assume P0 equals the initial call value computed by Black- Scholes formula. Use about 80,000 simulations. Use 100,200,400,800 rebalancing times (which are different from the value of N in Table 1). Show a table of results (mean, standard deviation, 95% VAR and CVAR) versus number of rebalancing times. Generate plot of the probability density of the relative P&L for the case of 800 rebalancing times. What do you observe about the mean and variance of the hedging error? (e) Bonus. Explain the discrepancy in the variance hedging error between the theoretical value under the continuous hedging assumption and the computed values using MC simulations. 5 [ (12 marks)] (MC Pricing Under Jump Model) Assume that Zt is a standard Brownian motion. Let qt denotes a Poisson counting process where the change dqt is defined as 􏰂 0 with probability 1 − λdt dqt = 1 with probability λdt, Table 2: Model Parameter Data Time to expiry Strike Price Initial asset price S(0) Intensity of Poisson Process λ ∆t 1 years $95 $95 0.304 0.308 0.34 .1 1/1000 where λ > 0 denotes the jump intensity. Consider the following risk neutral jump-diffusion process dS(t) =(r−λκ)dt+σdZ+(J−1)dqt (3)
S(t) = S(t−)J
where J corresponds to the random jump amplitude. In Merton’s jump model, logJ has a normal distribution, see §9, 9.1, 9.2, 9.4, 9.5 in the course notes for discussions on the Merton’s jump diffusion model and its implementation.
In contrast to the original Merton’s jump process, here we assume, instead, a double exponential jump process. Specifically, assume that, when jump occurs, the up-jump occurs with a probability pu and down-jump occurs with a probability 1 − pu and the density function of the jump amplitude J is a double exponential, i.e., the density function f(y) of y = log(J) is
f(y) = puμu exp(−μuy)1y>=0 + (1 − pu)μd exp(μdy)1y<0 (4) where 1y>=0 is an indicator which equals 1 if y >= 0 and 0 otherwise.
(a) Assume that μu > 1. Verify that
κ=E[J−1]= puμu +(1−pu)μd −1
μu − 1 μd + 1
(b) Assuming the underlying follows a jump diffusion process (3) with the density of log jump ampli- tude log(J) given in (4), using Monte Carlo method with Euler time stepping., write a Matlab function to compute the fair value of a European capped-call
val = CappedCall(S0, r, σ, pu, μu, μd, λ, K, T, C)
with strike K and expiry T. The payoff of a European capped-call is 􏰂􏰃
min max(ST − K, 0), C
Using parameter values in Table 2,, plot the computed option values with the number of (timesteps, simulations) = (800, 25000) for C = 20 : 10 : 100. How does the computed option value depend on the cap C ? Explain why your observation is reasonable. You can use the matlab function exprnd which generates a random sample from an exponential distribution in [0,+∞) with a probability density function
where the value S(t−) is the price just before jump and κ = E[J − 1]. Note that, if dqt = 1, then after

where μ > 0 is a parameter.
􏰂 1e−μx fX (x) = μ
ifx∈[0,+∞) otherwise
(c) Use Matlab function blsimpv to plot the implied volatility of the standard option price using your CappedCall(S0,σ,pu,μu,μd,λ,K,T,C), by setting C = +∞, with (timesteps, simulations) = (800, 25000) against the strike, e.g., K=linspace(70, 120, 20) and T = 1.
(d) Discuss observed characteristics of the implied volatility from the assumed jump model.

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com