Get startedGet started for free

Forecast growing expenses due to inflation

You will also assume your monthly expenses will rise by an average of 2.5% per year due to inflation. This will lead to higher cost of living over time, paying for the same expenses each year but at a higher price. Luckily, your salary is growing faster than inflation, which means you should have more money going into savings each month.

The monthly_expenses and forecast_months variables from the previous exercise are available.

This exercise is part of the course

Introduction to Financial Concepts in Python

View Course

Exercise instructions

  • Set the annual inflation rate to 2.5%.
  • Derive the equivalent monthly inflation rate.
  • Forecast cumulative inflation growth over time.
  • Derive your monthly expenses by adjusting for growth due to inflation.

Hands-on interactive exercise

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

import numpy as np

# Set the annual inflation rate
annual_inflation = ____

# Calculate the equivalent monthly inflation rate
monthly_inflation = ____

# Forecast cumulative inflation over time
cumulative_inflation_forecast = ____

# Calculate your forecasted expenses
expenses_forecast = ____

# Plot the forecasted expenses
plt.plot(expenses_forecast, color='red')
plt.show()
Edit and Run Code