CommencerCommencer gratuitement

The yield on the Moody's Baa index

In the previous chapter, you valued a bond with a $100 par value, 5% coupon rate, and 5 years to maturity. You then assumed a yield to maturity of 6% for that bond. Recall from the video that a bond's yield can be estimated by looking at the yield of comparable bonds.

In this exercise, you'll assume that the bond you valued has a Baa credit rating by Moody's and the bond will be issued on September 30, 2016. With this information, you can use the quantmod package in R to obtain the yield of the Moody's Baa index (use the ticker "DBAA" from src = "FRED") on September 30, 2016.

Cet exercice fait partie du cours

Bond Valuation and Analysis in R

Afficher le cours

Instructions

  • Use library() to load the quantmod package.
  • Use getSymbols() to obtain data on Moody's Baa index ("DBAA"). Save this data to baa.
  • Identify the yield for baa on September 30, 2016 using square brackets. Save this to baa_yield.

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Load quantmod library


# Obtain Moody's Baa index data
baa <- getSymbols("___", src = "FRED", auto.assign = FALSE)

# Identify 9/30/16 yield
baa_yield <- baa["___"]

baa_yield
Modifier et exécuter le code