Get Started

Calculate PV01 of a 10% bond

You can calculate the PV01 by calculating the value of a bond and the value of the same bond with a one basis point change in yield. In this exercise, you will calculate the PV01 of a bond with a $100 par value, 10% coupon, and 20 years to maturity assuming 10% yield to maturity.

Use the bondprc() function you created in Chapter One to value the two bonds. This function has been preloaded in your workspace. Make sure the result is a positive number.

This is a part of the course

“Bond Valuation and Analysis in R”

View Course

Exercise instructions

  • Calculate PV01 using the formula you saw in the video. Remember that PV01 is equivalent to the value of one bond minus the value of the other bond. To calculate this, you should use two calls to bondprc().
  • To get the correct answer, you should subtract the bond with the YTM of 10.00% from the bond with the YTM of 10.01%.
  • Also remember to take the abs() of this formula to ensure your output is positive.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Calculate the PV01

Edit and Run Code

This exercise is part of the course

Bond Valuation and Analysis in R

IntermediateSkill Level
4.8+
4 reviews

Learn to use R to develop models to evaluate and analyze bonds as well as protect them from interest rate changes.

Interest rate risk is the biggest risk that bond investors face. When interest rates rise, bond prices fall. Because of this, much attention is paid to how sensitive a particular bond's price is to changes in interest rates. In this chapter, we start the discussion with a simple measure of bond price volatility - the Price Value of a Basis Point. Then, we discuss duration and convexity, which are two common measures that are used to manage interest rate risk.

Exercise 1: Bond price volatility and the price value of a basis pointExercise 2: Price value of a basis pointExercise 3: Calculate PV01 of a 10% bond
Exercise 4: DurationExercise 5: Duration of a zero-coupon bondExercise 6: Calculate approximate duration for a bondExercise 7: Estimating effect on bond price using durationExercise 8: ConvexityExercise 9: Calculate approximate convexity for a bondExercise 10: Estimating effect of convexity on bond priceExercise 11: Estimating the bond price using duration and convexity

What is DataCamp?

Learn the data skills you need online at your own pace—from non-coding essentials to data science and machine learning.

Start Learning for Free