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.
Diese Übung ist Teil des Kurses
ARIMA Models in Python
Anleitung zur Übung
- Plot the
amazondata using the dates in the index of this DataFrame as the x coordinates and the values as the y coordinates. - Plot the
mean_forecastpredictions similarly. - Plot a shaded area between
lower_limitsandupper_limitsof your confidence interval. Use the index of one of these DataFrames as the x coordinates.
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
# 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()