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%.
This exercise is part of the course
Life Insurance Products Valuation in R
Exercise instructions
- 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?
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# 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