LoslegenKostenlos loslegen

Net present value of investments

Joe, the owner of Cynthia's favorite restaurant, asks for some advice. He wants to buy a new pizza oven, worth 10,000 EUR. He expects that this investment will generate additional cash flows but he wonders whether the new oven is a profitable investment.

You should calculate the net present value (NPV) of Joe's investment. This NPV is the sum of the present values of the future cash flows (in blue) generated by the investment, minus its initial cost of 10,000 (in red) at time 0.

What is your advice for Joe? Assume that interest rates are constant and equal to 5%.

Diese Übung ist Teil des Kurses

Life Insurance Products Valuation in R

Kurs anzeigen

Anleitung zur Übung

  • Create cash_flows with the positive cash flows related to the investment. The vector starts with a zero.
  • Define discount_factors as 1 plus the interest rate of 5% to minus a vector from 0 to 5.
  • Compute the net_present_value of the investment as the present value of the future profits minus the initial cost of 10,000. Will Joe realize an overall profit or loss?

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Define the cash flows
cash_flows <- c(0, ___(___, ___), ___(___, ___))
  
# Define the discount factors
discount_factors <- (1 + ___) ^ - (___)
  
# Calculate the net present value
net_present_value <- ___(___ * ___) - ___
net_present_value
Code bearbeiten und ausführen