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




Mathematics of Finance. Homework 4

 

1. a) Create a Matlab code modeling trajectories of a constant elasticity ofvariance process

dXt  = 0 .02Xtdt + 0 .25XdWt     where a=0.7. Process starts at 50. Consider a period T=1 years with 250 steps per trajectory and 7,000 trajectories. Plot the trajectories and submit the printout.

b) Assume that interest rate is 2% and a non-dividend paying stock in a risk neutral world follows such process. Write a Matlab code calculating price C of a European call maturing in 1 year with strike 48 with 100,000 trajectories.           How long does the code runs on your computer. Write the number of seconds and milliseconds.

 

2. Explain the difference between VaR and CVaR. (CVaR is also called Expected Shortfall, Average Value at Risk or AVaR,  Expected Tail Loss or ETL.)

 

3. On November 17, 2021 portfolio had 100,000 dollars in cash and was long 500 shares ofMSFT, long 400 Shares of AAPL and short 100 shares of SPY at a closing prices on November 17, 2021. Look for closing prices at Yahoo            finance.

a) What is the Net Asset Value (NAV) of portfolio on the close ofNovember 17, 2021, i.e. value ofmoney left if portfolio is liquidated.

b) What is the gross and net leverage of portfolio on close ofNovember 17, 2021? (See leverage explanation example at the end of the homework, on page 2)

c) Using historical data from Yahoo and assuming cash earned 1% annually with daily compounding, simulate in       spreadsheet portfolio NAV and leverage from January 4, 2010 to November 17, 2021. (Calculate portfolio NAV and portfolio leverage for every business day. Use split and dividend adjusted price, adj. close, last column on Yahoo.)

 

4. For portfolio described in the problem 3 make a spreadsheet: download data from January 4, 2010 to November 17,

2021. For each day from June 1, 2010 to November 17, 2021, calculate 90 days rolling volatility of portfolio for 1day and annualized:  AnnualizedVol=1dayVol * sqrt(250) Print a plot ofAnnualizedVol, 1dayVol,

 

5. For portfolio described in the problem 4 based on rolling 1 day volatility calculate 95% VaR for each day from June 1, 2010 to November 17, 2021.

VaR=1.645 * 1dayVol.

Print a plot ofVaR as a function oftime.

 

 

Leverage explanation and example.

Portfolio:

Long 1000 Shares AAPL with price 171.00

Long1000 shares of IBM with price 154.00

Short 500 Shares of SPY with price 264.00 and have

Cash 150,000 USD (that includes cash received from short sale).

 

NAV of Portfolio is the value of portfolio if it is liquidated: Longs sold, Shorts bought back.

NAV=1000*171 + 1000*154 - 500*264 + 150,000 = 343,000

GROSS LEVERAGE is calculated as:

(VALUE OF Long Stocks + ABS(VALUE of Short Stocks) / NAV

(1000*171 + 1000*154  + Abs(- 500*264) )/343,000  = 1.33 = 133%

 

 

NET LEVERAGE is calculated as:

(VALUE OF Long Stocks - ABS(VALUE of Short Stocks) / NAV

(1000*171 + 1000*154  - Abs(- 500*264) )/343,000  = 0.56 = 56%