Get startedGet started for free

Comparing annualized rates of return

In the last exercise, you saw that the annualized rate of return was 19.6%. That's pretty high! But since your portfolio consists of only 4 stocks, this high return is indeed possible as it is not very diversified. Let's compare the portfolio's annual rate of return, with that of the S&P500, which is much more diversified.

The value of the S&P500 between 1st of January 2015 and end of December 2018 has been made available. That's 4 years of data. You have full years this time, so use the year denomination in the formula for the annualized return. The data is stored under sp500_value.

This exercise is part of the course

Introduction to Portfolio Analysis in Python

View Course

Exercise instructions

  • Calculate the total return over the four years from the first and the last observation in sp500_value.
  • Calculate the annualized return from the total_return over four years.

Hands-on interactive exercise

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

# Calculate the total return from the S&P500 value series
total_return = (____[____] - ____[____]) / ____[____]
print(total_return)

# Annualize the total return spanning 4 years
annualized_return = ((____ + ____)**(____/____))-1
print (annualized_return)
Edit and Run Code