LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Bond Valuation and Analysis in R

Kurs anzeigen

Anleitung zur Übung

  • 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.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# 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
Code bearbeiten und ausführen