RSCRIPT REQUIRED TO COMPLETE ASSIGNMENT
FIN 740 – Fall AP1 2019
Assignment 5
Due: Sunday, October 6, 11 PM CST
※ Using the R script, answer the following questions. Please show all works for full credit.
1. [50 points] In Chapter 7 of our course materials, you have learned about how to value a bond.
Bond Price = ∑ 𝑃𝑎𝑟 × 𝑐
(1 + 𝑦)𝑖
𝑡
𝑖=1
+ 𝑃𝑎𝑟
(1 + 𝑦)𝑡 ,
where
𝑃𝑎𝑟: par value of the bond
𝑐: annual coupon rate
𝑡: time to maturity
𝑦: bond yield
Now, you have to find par value when we know all other variables, such as the bond price, coupon rate,
time to maturity, and yield. In order to find par value instead of bond price, you can use the following
formula (if you solve the equation above for 𝑃𝑎𝑟, you can easily obtain this formula).
Par = Bond Price × 1
∑ 𝑐
(1 + 𝑦)𝑖 +
1 (1 + 𝑦)𝑡
𝑡 𝑖=1
Suppose you are investing in a bond that has $1,091.5946 of current bond price, 5% of annual coupon rate, 5
years to maturity, and 3% of yield (discount rate). So, I have written these codes to calculate par value for
you.
# Create time t t <- seq(1, 5, 1) # Create present value factor pv_factor <- 1 / (1 + 0.03)^t # Coupon rate times pv_factor c_pv_factor <- 0.05 * pv_factor # Current bond price bond_value <- 1091.5946 # Par value par <- bond_value / (sum(c_pv_factor) + (1 / (1+0.03)^5)) par [1] 1000
Referring to the codes above, create your own function to calculate par value. That is, you have to complete
the body of the following function (bond_value: current bond price, c: annual coupon rate, ttm: time to
maturity, and y: yield).
par <- function (bond_value, c, ttm, y) { }
Note. After creating your own function, run the following codes. The answer should be as follows: par(1091.5946, 0.05, 5, 0.03) [1] 1000 par(1000, 0.07, 3, 0.06) [1] 973.9658 par(1500, 0.05, 15, 0.06) [1] 1661.355
2. [50 points] In Chapter 8 of our course materials, you could find call and put option price using Black-
Scholes option pricing model. Create your own function to calculate call option price. That is, you have to
complete the body of the following function (S0: current stock price, K: strike price, r: risk-free rate, T:
remaining time to maturity, and sigma: standard deviation of underlying stock price).
call <- function (S0, K, r, T, sigma) { }
Note. After creating your own function, run the following codes. The answer should be as follows: call(150, 90, 0.03, 2, 0.16) [1] 65.28859 call(400, 250, 0.06, 5, 0.14) [1] 214.9868 call(410, 360, 0.03, 6, 0.23) [1] 144.7023