Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
MFIN7017 Mid-term Exam
Please submit your write-up solutions in a
pdf file. The file name shall be
FirstName_LastName.pdf.
For instance, if your name is David Li, then
the file name shall be David_Li.pdf
If you plan to write directly on the pdf file
included in Midterm.zip, please rename it
to David_Li.pdf before submission.
Or if you choose to write up your solutions
in another file, then please save that file
as a pdf file with name David_Li.pdf for
submission instead.
GUIDELINES
Midterm is stored in a zip file. Unzip to retrieve two files below.
2
Complete and consolidate all your R code
in the Midterm.R for submission
Particularly, in Midterm.R, you will see the
variable your_name below
Update the variable your_name such that
for David Li it shall be
Once you are ready to submit, zip the
two files into David_Li.zip.
The subject of the email shall be
“Midterm David Li”
GUIDELINES
1. Your submission should reflect your individual work.
2. No late submission will be accepted.
3. Make sure your R code runs and that the output of R code matches your answer
corresponding to the green boxes in the following problems; otherwise, you will receive 0
points for the corresponding problem.
4. You can use time_to_expire to compute time to maturity. Feel free to write other functions
that facilitates your R code and save them all in Midterm.R .
time_to_expire <- function(cDate,eDate){
# cDate is current date of format 'yyyy-mm-dd’
# eDate is expiration date of format 'yyyy-mm-dd’
as.numeric((as.Date(eDate) - as.Date(cDate))/365)
}
3
Q1. CHANGE OF NUMERAIRE
() is a non-dividend paying stock. Consider a European style option with a payoff of 2 if > ,
otherwise it pays nothing. In the Black-Scholes world, what is the fair value of the option ?
Hint: (1) The payoff can be rewritten as 2 > (2) A suitable numeraire may facilitate the fair value evaluation.
4
Q2 IMPLIED DIVIDEND YIELD (IDIV)
Below are the near-the-money option quotes for USO for 3 different dates in 2020. USO’s options are of the
American style. What is the IDIV for each strike below on each date using mid -prices of calls and puts?
Compete the following R code for computing IDIV. The function returns the implied dividend yield required.
Current Date 2/18/2020
Call Put
Expiration Date 3/6/2020 Strike bid ask bid ask IDIV
Spot 10.94 10.5 0.59 0.61 0.15 0.16
Risk Free Rate 1.695% 11 0.29 0.3 0.34 0.35
Current Date 4/28/2020
Call Put
Expiration Date 5/15/2020 Strike bid ask bid ask IDIV
Spot 2.13 2 0.32 0.33 0.2 0.21
Risk Free Rate 0.760% 2.5 0.1 0.11 0.48 0.49
Current Date 6/8/2020
Call Put
Expiration Date 6/26/2020 Strike bid ask bid ask IDIV
Spot 28.44 28 1.74 1.81 1.29 1.34
Risk Free Rate 0.310% 29 1.32 1.35 1.86 1.91
5
IDIV <- function(bidC,askC,bidP,askP,K,S0,r,cDate,eDate){
# the function returns the implied dividend yield
# bidC is the bid price of call options
# askC is the ask price of call options
# bidP is the bid price of put options
# askP is the ask price of put options
# K is the strike
# S0 is the spot price
# r is the interest rate
# cDate is current date of format 'yyyy-mm-dd'
# eDate is expiration date of format 'yyyy-mm-dd'
# TTM is time to maturity of the options
TTM = time_to_expire(cDate,eDate)
# fill in the rest here ...
}
Q3 BINOMIAL TREE MODEL FOR AMERICAN CALL OPTION
Below is the same data as in Q2 for USO. Assume q=0, use the N=1000 period binomial tree model to estimate the
implied volatility for the following call option. Complete the following R code with secant method.
Current Date 2/18/2020 4:45 HKT
Call Put
Expiration Date 3/6/2020 Strike bid ask bid ask IV_Call
Spot 10.94 10.5 0.59 0.61 0.15 0.16
Risk Free Rate 1.695%
6
ivol_Binomial_C_v2_secant <- function(S0,K,r,q,cDate,eDate,bidC,askC,sigma0,sigma1,tol=10^(-6),maxIt=10000,N=1000){
# the function returns the implied volatility of American call option via secant method
# bidC is the bid price of call options
# askC is the ask price of call options
# K is the strike
# S0 is the spot price
# r is the interest rate
# q is the dividend yield
# cDate is current date of format 'yyyy-mm-dd'
# eDate is expiration date of format 'yyyy-mm-dd'
# sigma0 and sigma1 are initial guesses for secant method
# tol is tolerance for stopping of secant method
# maxIt is the max iteration for secant method
# N is the number of periods for the binomial tree model
# TTM is time to maturity of the options
TTM = time_to_expire(cDate,eDate)
# complete your code here ...
}
Q4 BLACK-SCHOLES IMPLIED VOLATILITY
Estimate the dividend yield first, then compute the implied volatility for SPX puts below. SPX options are of
the European style. Complete the R function in the next slide for calculating implied volatility.
C P
date exdate strike spot bid ask bid ask r IV_Put
20080917 20081018 1155 1156.39 44.5 50.5 39.9 45.9 0.03062
20080917 20081122 1155 1156.39 58.6 64.6 53.6 59.6 0.03063
20080917 20081220 1155 1156.39 66.9 72.9 61.3 67.3 0.03079
20080917 20090321 1150 1156.39 91.6 97.6 79.2 85.2 0.03145
20080917 20090620 1150 1156.39 109 115 95.3 101.3 0.03028
20080917 20091219 1150 1156.39 136.7 142.7 120.6 126.6 0.02861
20080917 20100619 1150 1156.39 158.5 164.5 139.9 145.9 0.02849
20080917 20101218 1150 1156.39 178.4 184.4 155.1 161.1 0.02964
C P
date exdate strike spot bid ask bid ask r IV_Put
20120917 20121020 1460 1461.19 21.6 22.7 21.7 23.6 0.00219
20120917 20121117 1460 1461.19 30.3 32.5 33.6 35.8 0.00297
20120917 20121222 1460 1461.19 39.8 42.1 45.7 48.2 0.00379
20120917 20130316 1450 1461.19 65.2 68.3 68.2 71.2 0.0035
20120917 20130622 1450 1461.19 84.9 89.2 94.9 99.4 0.00343
20120917 20131221 1450 1461.19 110 115.9 134.4 140.8 0.00347
20120917 20140621 1450 1461.19 129.5 138.2 168.8 178.4 0.00361
20120917 20141220 1450 1461.19 145.5 155.2 198.2 208.7 0.0039
7
8ivol_BS_P_secant <- function(S0,K,r,cDate,eDate,bidC,askC,bidP,askP,sigma0,sigma1,tol=10^(-6),maxIt=10000){
# the function returns the implied volatility under Black-Scholes model via secant method
# bidC is the bid price of call options
# askC is the ask price of call options
# bidP is the bid price of put options
# askP is the ask price of put options
# K is the strike
# S0 is the spot price
# r is the interest rate
# cDate is current date of format 'yyyy-mm-dd'
# eDate is expiration date of format 'yyyy-mm-dd'
# sigma0 and sigma1 are initial guesses for secant method
# tol is tolerance for stopping of secant method
# maxIt is the max iteration for secant method
# TTM is time to maturity of the options
TTM = time_to_expire(cDate,eDate)
# complete your code here ...
}
Q4 BLACK-SCHOLES IMPLIED VOLATILITY
Complete the R function below for calculating implied volatility for Q4.