↓ Skip to main content
  1. Posts/

Three Statsmodels Tricks for Time Series Forecasting

··166 words·1 min·

📈 statsmodels can do more than produce point forecasts: its results already include tools for measuring uncertainty and updating models.

  • Forecasts with intervals: get_forecast() returns both expected values and confidence intervals; summary_frame() puts them together in a table.
  • New data without refitting: append(..., refit=False) adds observations while keeping estimated parameters. extend() processes only new data, while apply() is for a different series.
  • Simpler seasonality: STLForecast removes seasonality, forecasts the adjusted series, and combines the result again.

The author demonstrates all three methods on the same monthly CO₂ series using an ARIMA model. The idea is to use what the results object has already computed instead of rebuilding it by hand.

💡 Explanation in a nutshell
#

A forecast is an estimate, not a certainty. Intervals show a plausible range; update functions let you use recent data without starting over; and handling seasonality helps when patterns repeat, such as each year.

More information at the link 👇

More in the following external reference.
Also published on LinkedIn.

Juan Pedro Bretti Mandarano
Author
Juan Pedro Bretti Mandarano