MTH 408 Computational Methods in Finance Ⅱ Year 2021 Spring
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
MTH 408
2st SEMESTER 2020/21 FINAL EXAMINATIONS
Financial Mathematics MSc DEGREE - Year 2021 Spring
Computational Methods in Finance Ⅱ
Questions
Q 1.(18 marks) The stochastic differential equation for the short rates in the Vasicck interest rate model is given
asdr(t)=a(b-r(t))dt+adW(t) (1)
whereα>0,b>0,σ>0 are the speed of mean reversion, long-term mean, and volatility, respectively.
(a)(5 marks)Derive the solution for the short rate r(t) given the initial value r(0).
(b)(5 marks)Explain how you can simulate the short rate paths recursively in the Vasicek model using the exact solution over a uniform grid with time steps △t. Write down the Euler discretization for the
Vasicck model. Write down the main difference between the two.
(c)(5 marks) Write the MATLAB code for the Euler discretization to simulate 100 interest rate paths with daily time increments (i.c. △t =1/252) for 252 trading days for the paramctersα=0.4,b=0.05,σ=
0.02. In the simulation assume that the initial interest rate is 0.04.
(d)(3 marks)Write the MATLAB code to plot the simulated short rate paths in part (c).
Q2. (30 marks) Use the datasct "Commodity.mat" provided and the Neural network classification functions in
MATLAB for solving this question.
(a)(5 marks)Using the silver futures log-returns construct your dependent variable (Y) for the binary classification with Neural Networks, where Y equals to 1 for positive log-returns, else set Y as 0.
(b)(5 marks) Construct the features matrix X. The first feature you will use is the rsi index given by rsindex(.)function in MATLAB. The sccond feature is the indicator function with value equal 1 if the close price is above the 10-day simple moving average, else set the value as 0. The third feature is defined as the indicator function taking the value 1 if the 10-day moving average is above the 50-day moving average, else the value is 0. Make sure to pre-process your data by climinating the NaNs and standardizing all the inputs with zscores.
(c)(10 marks) Using the whole sample sizc estimate the Neural Networks classifier. Use MATLAB's built- in function patternet(..)with 5 activation units in the hidden layer and calculate the model accuracy. Now, use 50 activation units in the hidden layer and compare results, do you obscrve any significant
difference?
(d)(10 marks) Split 15% of your sample size for the out-of-sample testing and using the estimated parameters from the first 85% of the sample, predict the log-returns in the out-of-sample testing and report the accuracy of your model. What is your conclusion comparing the in-sample and out-of-sample accuracy of your model? Again try with 5 and 50 activation units report if you observe any difference in the
accuracy.
Q 3.(28 marks) In the Black-Scholes option pricing model, the formula for pricing a European call option is given by
Call Price =更(d₁)So- 更(d₂)Ke-rsT, (2)
where ]and d2=d-σ√T,ry is the risk-free rate,σ>0 is the volatility, So the initial price, T is the maturity,更(.) is the standard normal cdf, and K is the strike price of the option.
(a)(7 marks)Write a MATLAB function that calculates the above Black-Scholes option prices for the European call and put options. For the put option price use the put-call parity.
(b)(7 marks) Write the exact solution for S(t) in the Black-Scholes model and explain the steps to simulate the stock price paths using Monte Carlo over the time grid0=to
(c)(7 marks) Write a MATLAB script that simulates and plots the stock price paths with M = 100 time steps given the following set of paramcters: So =100,K=100,ry=0.02,T=0.5,σ=0.3 for N=10 number of paths.
· A discrete "down and in" barrier put option is given with the payoff: 1{r
T=inf{t>0:S(t)≤B}, (3)
where B< So is the barrier level.
(d)(7 marks)Write a MATLAB code that estimates the price of the Barricr put option using the conditional Monte Carlo estimator for paramcters: So =100,K=100,B=99,ry=0.02,σ=0.3,T=0.5,M= 100,N=10000.Compare the Barrier put option price with the European put option price and write which option's price is expected to be lowcr.
Q 4.(24 marks)Consider a portfolio of d assets with portfolio weights w =(wi,W2,..,wa) and assume that the daily returns of these d stocks follow N(μdx₁,Edxd) with the vector of expected returns μ and covariance matrix Z.
(a)(6 marks)Write down the step by step procedure for simulating N daily return rcalizations for the portfolio.
(b)(9 marks)Write a MATLAB function that simulates N portfolio returns from the multi-variate normal distribution N(μdx1,Zdxd). Additional to the N simulated values your function should be able to return the a-percentile value of the simulated sample.
(c)(9 marks) Consider two stocks with w =(0.4,0.6) and the distribution of daily rcturns given by N(0,2),
where! . Estimate the portfolio 95% VaR (daily horizon) using the function in part (ii). by
simulating 1000 portfolio returns.
2023-05-24