Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MTH 408

2st SEMESTER 2018/19 FINAL EXAMINATIONS

Financial Mathematics MSc DEGREE - Year 2019 Spring

Computational Methods in Finance II

Questions

Q 1.  (25 marks) Consider that we have the basket call option written on the average of two assets denoted as SA and SB and the payoff is given as

max((SA(T) + SB(T))/2 - K, 0),

where K is the strike price and Tis the maturity time.  Write the appropriate MATLAB code to price this basket option in the multi-asset Black-Scholes model with the following parameters using the Monte Carlo simulation method.


(a)  (15 marks) Write the MATLAB function to price such baskets options for the given set of parameters. Name this function as [call,put] = SpreadOptionMC(SA,SB,rf,T,K,Covariancc,N), where SA,SB are initial prices of two assets, rJ is the risk-free rate, T maturity time, K is the strike price, Covariance is the covariance matrix of two assets, and N is the sample size in the Monte Carlo simulation. Output should include the call and put prices.

(b)  (10 marks) Calculate the call and put prices for the basket option for the following set. of parameters: 

SA(O) = 100, S3 (0) = 105, T = 0.3, r1 = 0.03, K = 103, and the covariance matrix of these two assets is given as 

E =

-0.01     0.09


Q 2.  {30 marks) Please use the dataset "Commodity.mat" provided and the MATLAB's built in neural network

toolbox functions for solving this question.  Use the gold futures prices provided in the dataset, where the ticker ID for gold futures is "au", i.e. corresponding to the fourth column in the close prices.

(a)  (5  marks)  Using the gold futures log-returns construct your dependent variable  (Y)  for the binary

artificial neural networks classification problem in the appropriate format, where the target variable Y equals to 1 for positive log-returns, whereas Y equals to O for negative log-returns.

(b)  (5 marks) Start to design the features matrix X using the last three lagged log-returns, i.e.  using the

log-returns: Tt- 1, rt-2, rt-3 ·

(c)  (5 marks) Construct the moving average for the close prices of the gold futures with the lead and lag                 

values equal to 5 and 50 days, respectively.  Set your new feature equal to 1 whenever the fast moving average is above the slow one, and set it equal to -1, otherwise. Make sure that you do not utilize future information (no data leakage). Include the moving average signal in the design matrix X and normalize your data by subtracting the means and dividing by the standard deviation of each feature.

(d)  (5 marks) Use.MATLAB's pattern recognition built-in function "patternnet(K)", where K is the number

of hidden layers.  Train your neural network utilizing all the available data to construct your features

How does your result change with respect to the increasing number of hidden layers?

(e)  (10 marks) Split about 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 classification of log-returns in the out-of-sample

hidden layers.  What is your conclusion comparing the in-sample and out-of-sample accuracy of your model?

Q 3. (20 marks) The double exponential density on the domain (-00,00) is given as

g(x) = 2exp(-lxl),           (1)

and the normal density is given as

J(x) =   exp(-x2 /2),                                  (2)

where their ratio is  :S; c ;::, 1.32. The acceptance-rejection algorithm for sampling the standard normal

random variables via the double exponential density is given as:

1 Generate U1, U2, Us from Unijorm(O, 1)

2 Set X = - ln(U1 )

3 If U2 > exp(-0.5(X - 1)2 ) go to Step 1

4 Ua :S; 0.5, X = -X

5   return X.

(i) (10 marks) Using the above acceptance-rejection algorithm given write down a MATLAB function that generates standard normal random variables from the acceptance-rejection method.

(ii) (10 marks) Write a MATLAB script to test your function in part (i) by generating 1000 standard normal random variables and calculate the Jarque-Bera test statistic given as

JB =; (S2 + (K  3)3 /4),                                                  (3)

where N is the sample size, Sis the sample skewne.8S, and J( is the sample kurtosis, respectively. Compare your statistic with the critical value of 5.71 at the 95% confidence level. What is your conclusion?

Q 4.  (25 marks) Use the "Commodity.mat" dataset provided. Open and close prices of the silver and gold futures

are given in the dataset.   Note that the ticker for silver and gold futures are given as  "ag"  and  "au", respectively. Use the open and close prices of these two products for the rest of the question.

(a)  (6 marks) Calculate the open to close returns for the silver and gold futures, i.e.  the intra-day return from open to close in each trading day. Plot the empirical density of silver and gold intra-day returns using the kernel density function "ksdensity(...)".

(b)  (6 marks) Standardize the intra-day returns of gold and silver and plot the scatter histogram for the joint distribution of these returns.  Use the matlab plotting function "scatterhist(.., ..)"  and save your figure in the .eps format.

(c)  (7 marks) Estimate the Value-at-Risk (VaR) and expected shortfall (ES) for the daily intra-day returns using the empirical distribution of intra-day returns with the 95% confidence level for the long and short positions.  Also compare the value-at-risk and expected shortfall values of these two assets for the long and short positions.

(d)  (6 marks) Suppose we form a portfolio of silver and gold futures with investment weights 0.4 and 0.6, respectively.  Then calculate the empirical VaR and ES for this portfolio of intra-day investment, i.e. using the open to close returns, with the 95% confidence level.