Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesiTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
Three practical choices make Statsmodels time-series forecasts easier to interpret: select a model that fits the series, handle recurring seasonality explicitly when needed, and decide whether you want one-step predictions or a dynamic forecast path. These are complementary techniques, not a universal recipe; compare candidate forecasts on future data your model did not see.
1. Start with a model that matches the structure of your series
For a straightforward autoregressive baseline, Statsmodels provides AutoReg. It models a value using selected lags of the series, and can also include seasonal effects and exogenous regressors. Its parameters are estimated using conditional maximum likelihood, equivalent to OLS in this setting. The Statsmodels time-series documentation introduces it as the library’s basic autoregressive model: AutoReg examples.
Move to SARIMAX when your modeling question calls for integrated terms, seasonal or nonseasonal moving-average terms, or a broader state-space specification. It supports exogenous variables and estimates by maximum likelihood using the Kalman filter. The documented difference is in model capabilities and estimation, not proof that one model forecasts better for every dataset: SARIMAX example and comparison.
| Model | Useful when | Documented approach |
|---|---|---|
AutoReg |
You want an autoregressive baseline, potentially with seasonal effects or regressors. | Conditional maximum likelihood/OLS for the AR specification. |
SARIMAX |
You need seasonal or nonseasonal AR and MA terms, integration, exogenous variables, or state-space modeling. | Maximum likelihood using the Kalman filter. |
Choose lag orders and seasonal structure deliberately rather than treating a model name as a shortcut. If you include an external predictor, you also need its values for the forecast period; a model cannot produce a usable exogenous-variable forecast from values that will not be available at prediction time. See the AutoReg API and SARIMAX API for documented options.
#1 Best Overall
2. Use STLForecast when recurring seasonality needs explicit treatment
When a series has a recurring seasonal pattern, STLForecast provides a workflow that uses STL to remove seasonality before fitting a forecasting model. The period is a modeling choice: set it to match the observation frequency and the real cycle you are trying to represent, such as a yearly pattern in monthly observations. The API describes the method and available interface: STLForecast API.
- Set the seasonal period. Base it on how observations are spaced and the domain’s recurring cycle; do not infer it from a convenient default alone.
- Choose the forecasting model. STLForecast applies STL decomposition and then fits the selected forecasting model to the seasonally adjusted component.
- Forecast the horizon you need. Keep the intended forecast length and dates clear when communicating results.
- Compare on held-out future observations. Evaluate the STL-based approach against reasonable alternatives using the same forecast dates and a metric suited to your decision.
Decomposition does not prove that the remaining component is stationary, easy to predict, or superior to another method. Use STLForecast when the seasonal structure is relevant, then let out-of-sample performance help determine whether it is useful for your series.
Rank #2
3. Set prediction mode deliberately—and show uncertainty
A one-step-ahead prediction and a dynamic forecast answer different questions. In one-step-ahead prediction, the model uses actual observed endogenous values at each step. In dynamic prediction, observations are used only up to the selected dynamic start; after that, the model feeds its earlier predictions into later steps. The dynamic path can therefore depart from observed values more quickly as the horizon extends. Statsmodels explains this distinction in its state-space forecasting example.
Use one-step predictions to assess estimates that incorporate newly observed data at each period. Use a dynamic forecast when you need a multi-step path generated from a fixed origin—for example, forecasting several future periods before new observations arrive. Label the dynamic start clearly in any chart or report, since comparing it directly with one-step estimates can mislead.
Rank #3
For SARIMAX, get_prediction supports in-sample prediction and out-of-sample forecasting; the returned prediction results include interval information. AutoReg also provides prediction results, and its end index is inclusive. For date-based out-of-sample AutoReg forecasting, use a fixed-frequency date index; without one, integer indices are needed. Check the API for the Statsmodels version installed, since signatures can change between releases: SARIMAX prediction results API and AutoReg prediction API.
Report prediction intervals alongside point forecasts when the result object provides them. A point estimate alone hides uncertainty, which generally depends on the forecast horizon, data, and model specification. Intervals are not guarantees that future values will fall inside them.
Rank #4
- Used Book in Good Condition
Check diagnostics, then evaluate forecasts on future data
Statsmodels includes tools that support model building and diagnosis: order selection and information criteria, autocorrelation and partial-autorrelation tools, unit-root tests, and forecast-comparison methods. These help investigate structure and compare candidates; no diagnostic p-value or information criterion guarantees good future forecasts. The time-series API overview lists these capabilities.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →- Compare candidate models on the same held-out future periods.
- Use a metric that reflects the cost of forecast errors for your application.
- Assess the horizon you actually care about; a model’s one-step performance does not establish its quality over a longer dynamic path.
- Keep the model specification, observation frequency, forecast dates, and prediction mode explicit so the evaluation can be interpreted.
The Statsmodels documentation describes these model families and APIs, but does not establish a general benchmark showing that one approach wins across time series. For code, verify method signatures against the documentation for your installed release; the stable documentation pages may reflect different versions.
Quick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

