ComenzarEmpieza gratis

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.

Este ejercicio forma parte del curso

Introduction to Financial Concepts in Python

Ver curso

Instrucciones del ejercicio

  • 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.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

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()
Editar y ejecutar código