ComeçarComece de graça

Plotting dynamic forecasts

Time to plot your predictions. Remember that making dynamic predictions, means that your model makes predictions with no corrections, unlike the one-step-ahead predictions. This is kind of like making a forecast now for the next 30 days, and then waiting to see what happens before comparing how good your predictions were.

The lower_limits, upper_limits and amazon DataFrames as well as your mean predictions mean_forecast that you created in the last exercise are available in your environment.

Este exercício faz parte do curso

ARIMA Models in Python

Ver curso

Instruções do exercício

  • Plot the amazon data using the dates in the index of this DataFrame as the x coordinates and the values as the y coordinates.
  • Plot the mean_forecast predictions similarly.
  • Plot a shaded area between lower_limits and upper_limits of your confidence interval. Use the index of one of these DataFrames as the x coordinates.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# plot the amazon data
plt.plot(____, ____, label='observed')

# plot your mean forecast
plt.plot(____, ____, color='r', label='forecast')

# shade the area between your confidence limits
plt.____(____, ____, 
         ____, color='pink')

# set labels, legends and show plot
plt.xlabel('Date')
plt.ylabel('Amazon Stock Price - Close USD')
plt.legend()
plt.show()
Editar e executar o código