Skip to content
tezvyn:
Menu

ARIMA: Forecasting by Modeling Autocorrelation

Source: otexts.comHardHow cards are made

ARIMA: Forecasting by Modeling Autocorrelation

ARIMA models forecast a time series by learning its "memory"—how past values influence the next. It's used for forecasting sales or server load where patterns are driven by internal dynamics.

The mental model

An ARIMA model provides a way to forecast a time series by describing the autocorrelations within the data. While other methods like exponential smoothing focus on describing the trend and seasonality, ARIMA focuses on the data's relationship with itself. Think of it as modeling the series' "memory": how much does yesterday's value, and the error in yesterday's forecast, tell you about today's value?

How it works

ARIMA stands for Autoregressive Integrated Moving Average. The model combines three concepts. First, the 'Integrated' (I) part addresses stationarity. A time series is stationary if its statistical properties, like its mean, don't change over time. Most real-world data isn't stationary. To fix this, we apply "differencing," subtracting the previous value from the current value one or more times until the series is stable. Second, the 'Autoregressive' (AR) part models the relationship between an observation and a number of lagged observations (past values). Third, the 'Moving Average' (MA) part models the effect of past forecast errors (random shocks) on the current observation. The model's behavior is configured by three parameters (p, d, q) that define the order of the AR model, the degree of differencing, and the order of the MA model.

When to use it

Use ARIMA when a time series shows clear autocorrelation, meaning its past values are correlated with its future values. It is a powerful and flexible model for short-to-medium term forecasting, especially when the underlying patterns are not simple linear trends or fixed seasonal cycles. It is one of the most widely used methods for forecasting economic data, server metrics, and inventory levels.

When not to use it

Do not use ARIMA on data with no clear autocorrelation (i.e., white noise). It is also less effective for very long-term forecasting, as predictions can revert to the mean and become uninformative. If you have known external variables that influence the time series (like marketing spend affecting sales), a dynamic regression model may be more appropriate. Complex seasonality can also be difficult to model effectively with a standard ARIMA approach.

One canonical example

Imagine forecasting a company's stock price. The raw price series trends up and down, making it non-stationary. Applying ARIMA, you would first apply differencing to get the daily price changes, which is a more stationary series. The model would then learn from these daily changes. The Autoregressive part might find that a large positive change yesterday is often followed by a small negative change today. The Moving Average part might account for the lingering effects of a surprise earnings announcement. The final forecast for tomorrow's price is calculated by predicting tomorrow's change and adding it to today's price.

Interview question

Which of the following best describes the primary role of the 'Integrated' (I) component in an ARIMA model?

  • a.It incorporates external variables to improve forecast accuracy.
  • b.It accounts for the cumulative impact of random shocks or past forecast errors.
  • c.It applies differencing to achieve stationarity, making the series' statistical properties constant.Correct
  • d.It models the direct linear relationship between an observation and its preceding values.
Why?

The card explicitly states that the 'Integrated' (I) part addresses stationarity by applying differencing to make the series' statistical properties constant. Options A and B describe the Autoregressive (AR) and Moving Average (MA) components, respectively, while option A refers to external variables, which are typically handled by dynamic regression models, not standard ARIMA.

Just read this? Test yourself on what you have been reading.

Read the original → otexts.com

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on time series — each one lists the topics its interview covers.

See open roles