1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to R for Finance

Connected

Exercise

Financial returns (1)

Time for some application! Earlier, Lore taught you about financial returns. Now, its time for you to put that knowledge to work! But first, a quick review.

Assume you have $100. During January, you make a 5% return on that money. How much do you have at the end of January? Well, you have 100% of your starting money, plus another 5%: 100% + 5% = 105%. In decimals, this is 1 + .05 = 1.05. This 1.05 is the return multiplier for January, and you multiply your original $100 by it to get the amount you have at the end of January.

105 = 100 * 1.05

Or in terms of variables:

post_jan_cash <- starting_cash * jan_mult

A quick way to get the multiplier is:

multiplier = 1 + (return / 100)

Instructions

100 XP
  • Your new starting cash, January's return, and January's return multiplier have been defined for you.
  • Use them to calculate post_jan_cash.
  • Print post_jan_cash.
  • What if the return for January was 10%? Calculate the new jan_mult_10.
  • Calculate post_jan_cash_10 using the new multiplier!
  • Print post_jan_cash_10 to see the impact of different interest rates!