Get startedGet started for free

Generating dynamic forecasts

Now lets move a little further into the future, to dynamic predictions. What if you wanted to predict the Amazon stock price, not just for tomorrow, but for next week or next month? This is where dynamical predictions come in.

Remember that in the video you learned how it is more difficult to make precise long-term forecasts because the shock terms add up. The further into the future the predictions go, the more uncertain. This is especially true with stock data and so you will likely find that your predictions in this exercise are not as precise as those in the last exercise.

This exercise is part of the course

ARIMA Models in Python

View Course

Exercise instructions

  • Use the results object to make a dynamic predictions for the latest 30 days and assign the result to dynamic_forecast.
  • Assign your predictions to a new variable called mean_forecast using one of the attributes of the dynamic_forecast object.
  • Extract the confidence intervals of your predictions from the dynamic_forecast object and assign them to a new variable confidence_intervals.
  • Print your mean predictions.

Hands-on interactive exercise

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

# Generate predictions
dynamic_forecast = results.______(____=___, ____=____)

# Extract prediction mean
mean_forecast = ____.____

# Get confidence intervals of predictions
confidence_intervals = ____.____

# Select lower and upper confidence limits
lower_limits = confidence_intervals.loc[:,'lower close']
upper_limits = confidence_intervals.loc[:,'upper close']

# Print best estimate predictions
print(____)
Edit and Run Code