Get startedGet started for free

SARIMA vs ARIMA forecasts

In this exercise, you will see the effect of using a SARIMA model instead of an ARIMA model on your forecasts of seasonal time series.

Two models, an ARIMA(3,1,2) and a SARIMA(0,1,1)(1,1,1)\(_{12}\), have been fit to the Wisconsin employment time series. These were the best ARIMA model and the best SARIMA model available according to the AIC.

In the exercise you will use these two models to make dynamic future forecast for 25 months and plot these predictions alongside held out data for this period, wisconsin_test.

The fitted ARIMA results object and the fitted results object are available in your environment as arima_results and sarima_results.

This exercise is part of the course

ARIMA Models in Python

View Course

Exercise instructions

  • Create a forecast object, called arima_pred, for the ARIMA model to forecast the next 25 steps after the end of the training data.
  • Extract the forecast .predicted_mean attribute from arima_pred and assign it to arima_mean.
  • Repeat the above two steps for the SARIMA model.
  • Plot the SARIMA and ARIMA forecasts and the held out data wisconsin_test.

Hands-on interactive exercise

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

# Create ARIMA mean forecast
arima_pred = arima_results.____
arima_mean = arima_pred.____

# Create SARIMA mean forecast
sarima_pred = sarima_results.____
sarima_mean = ____

# Plot mean ARIMA and SARIMA predictions and observed
plt.plot(dates, sarima_mean, label='SARIMA')
plt.plot(dates, arima_mean, label='ARIMA')
plt.plot(wisconsin_test, label='observed')
plt.legend()
plt.show()
Edit and Run Code