# 9 Adding external variables to our model

### This chapter covers

- Examining the SARIMAX model
- Exploring the caveat of using external variables for forecasting
- Forecasting using the SARIMAX model

From chapter 4 to 8, we have increasingly built a more general model that allows us to consider more complex patterns in time series. We started our journey with only autoregressive and moving average processes, before combining them into the ARMA model. Then, we added a layer of complexity that allows modeling non-stationary time series, leading us to the ARIMA model. Finally, in the last chapter, we added yet another layer to ARIMA, which allows us to consider seasonal patterns in our forecasts, hence reaching the SARIMA model.

Up until now, each model that we have explored and used to produce forecasts considers only the time series itself. In other words, past values of the time series were used as predictors for future values. However, it is possible that external variables also have an impact on our time series and can therefore be good predictors of future values.

This brings us to the SARIMAX model. We notice the addition of the X term, which denotes exogenous variables. Note that in statistics, the term exogenous is used to describe predictors or input variables, while endogenous is used to define the target variable; what we are trying to predict.

With the SARIMAX model, we can now consider external variables, or exogenous variables, to forecast a time series.