Quantative Risk Management In R

Murthy
Assignment7.pdf

FIN 740 – Fall AP1 2019

Assignment 7

Due: Sunday, October 20, 10 AM CST

※ No need to use R for this question. Please type the answer. Please show all works for full credit.

1. The probability density function (pdf) for daily profits at Rectangle Inc. can be described by the following

piecewise function (see figure below),

p = 1

24 for −12 ≤ π ≤ 0

p = 1

20 for 0 ≤ π ≤ +10

p

1

20

1

24

-12 0 +10 𝜋

a) [15 points] What is the one-day 95% VaR for Rectangle Inc.?

b) [25 points] What is the one-day 95% ES for Rectangle Inc.?

※ Using the R script, answer the following questions. Please show all works for full credit.

2. Please follow the following instructions. The instructions indicate how to download daily stock price of

Microsoft. Inc. from 2005-01-02 to 2018-12-31 from Yahoo! Finance and how to convert it to daily log return.

library(quantmod)

getSymbols("MSFT", src = "yahoo", from='2005-01-02', to='2018-12-31')

MSFT.Adj <- MSFT$MSFT.Adjusted

logreturns <- diff(log(MSFT.Adj))

logreturns <- logreturns[-1,]

a) [15 points] Assuming that the daily log returns for Microsoft Inc. follow normal distribution, estimate 99%

VaR.

b) [15 points] Assuming that the daily log returns for Microsoft Inc. follow normal distribution, estimate 99%

ES.

c) [15 points] Estimate the 99% VaR based on the sample distribution.

d) [15 points] Estimate the 99% ES based on the sample distribution.