Get startedGet started for free

Rising housing prices

Home values have been rising steadily each year, and this is a rather large investment for you.

Calculate your home equity value over time given a steady growth rate of 0.25% per month. A repeated array of this growth rate (with a length equal to the number of mortgage payment periods) is already stored for you in an object called growth_array.

The home_value and cumulative_percent_owned variables from the previous exercise are available.

This exercise is part of the course

Introduction to Financial Concepts in Python

View Course

Exercise instructions

  • Calculate the cumulative growth over time using np.cumprod() and growth_array.
  • Forecast the home value over time using cumulative growth array and the initial home_value .
  • Forecast the portion of home equity value owned over time given the home_value_forecast and cumulative_percent_owned.
  • Run the provided code to see a plot of Home Value vs. Home Equity over time.

Hands-on interactive exercise

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

import numpy as np

# Calculate the cumulative growth over time
cumulative_growth_forecast = ____

# Forecast the home value over time
home_value_forecast = ____

# Forecast the home equity value owned over time
cumulative_home_value_owned = ____

# Plot the home value vs equity accumulated
plt.plot(home_value_forecast, color='red')
plt.plot(cumulative_home_value_owned, color='blue')
plt.legend(handles=[homevalue_plot, homeequity_plot], loc=2)
plt.show()
Edit and Run Code