Session Ready
Exercise

Bond valuation

In Chapter One, you valued a bond using a step-by-step approach. In this exercise, you will value a bond with a $100 par value, 3% coupon rate, and 8 years to maturity. You will layout the bond's cash flows and calculate the present value of each of those cash flows using the Aaa yield you obtained in the previous exercise.

The aaa_yield object is preloaded into your workspace.

Instructions
100 XP
  • Create a cash flow object (cf) containing the bond's cash flows.
  • Use data.frame() to convert cf into a data frame so you can add additional variables needed for your analysis.
  • Add a time indicator (cf$t) representing years from 1 to 8 using the seq() command.
  • Calculate PV factor (cf$pv_factor) based on the Moody's Aaa yield (aaa_yield) and your time indicator (cf$t).
  • Calculate the present value of each cash flow (cf$pv) as the product of cf$cf and the PV factor (cf$pv_factor).
  • Finally, calculate the price of the bond as the sum() of the present value of each cash flow.