CommencerCommencer gratuitement

Computing a bond's future value

Recall from the video that the future value of $100 will be more than $100 because you have to be compensated for the opportunity cost (e.g., interest rate) that you forego by not having that money now (and investing it!). The longer you have to forego being able to use that money, the larger your opportunity cost grows.

The growth rate of the opportunity cost is compounded, which means the future value of $100 two years from now is equal to the future value of $100 one year from now growing at the opportunity cost (i.e., the opportunity cost grows at a compounded rate).

In this exercise, you will calculate the future value of $100 one year from now and two years from now assuming an opportunity cost of 10%.

Cet exercice fait partie du cours

Bond Valuation and Analysis in R

Afficher le cours

Instructions

  • Create pv (present value) with a value of 100.
  • Create r (interest rate) of 0.10.
  • Calculate the future value of $100 one year from now using pv and r with basic mathematical operations in R. Store this to fv1.
  • Calculate the future value of $100 two years from now using pv and r with basic mathematical operations in R. Store this to fv2.

Exercice interactif pratique

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

# Create pv
pv <- 

# Create r
r <- 

# Calculate fv1
fv1 <- ___ * (1 + ___)

# Calculate fv2
fv2 <- 
Modifier et exécuter le code