Understanding Autoregressive (AR) Models for Time Series Forecasting

Jai Chaudhari
2 min readJul 25, 2023

--

Introduction

Autoregressive (AR) models are powerful tools used in time series analysis to predict future values of a variable based on its own past values. In this article, we will explain the concept of AR models in simple language using an example to forecast temperatures in a city.

What is an Autoregressive (AR) Model?

An autoregressive model is a type of time series model that assumes the current value of a variable depends on its previous values. In other words, what happened in the past can give us a clue about what might happen in the future. It’s like using historical data to forecast upcoming trends.

Example: Forecasting Tomorrow’s Temperature

To illustrate how AR models work, let’s consider a temperature dataset recording daily temperatures in a city. Our goal is to predict tomorrow’s temperature using an AR model.

The AR(1) Model

The AR(1) model, with an order of 1, means we will only use the temperature from the previous day to predict the current day’s temperature. The model equation is:

Tomorrow’s temperature (T_tomorrow) = β0 + β1 * Today’s temperature (T_today) + ε

In this equation:
- T_tomorrow represents the temperature we want to predict for tomorrow.
- T_today is the temperature recorded today (the value we know).
- β0 and β1 are coefficients that the AR model calculates to make the prediction.
- ε is an error term representing the difference between the predicted temperature and the actual temperature.

Model Coefficients and Today’s Temperature

Suppose, based on historical data, our AR(1) model finds the following values for the coefficients:
- β0 = 2 (intercept term)
- β1 = 0.7 (coefficient for today’s temperature)

Let’s say today’s temperature (T_today) is 28 degrees Celsius.

Making the Prediction

Now, we can use the AR(1) model to predict tomorrow’s temperature (T_tomorrow):

T_tomorrow = 2 + 0.7 * 28 + ε
T_tomorrow = 2 + 19.6 + ε
T_tomorrow = 21.6 + ε

The Prediction

The AR(1) model predicts that tomorrow’s temperature will be 21.6 degrees Celsius. However, keep in mind that the actual temperature might differ slightly due to the error term (ε), which accounts for unpredictable factors not considered by the model, such as sudden weather changes.

Conclusion

Autoregressive (AR) models provide valuable insights into time series forecasting by leveraging a variable’s own past values. This simple yet effective approach helps us make informed predictions about future trends and patterns. AR models serve as fundamental tools in time series analysis and forecasting, enabling us to make more accurate and data-driven decisions.

Happy forecasting!

--

--

Jai Chaudhari

Junior Research Fellow @ Ahmedabad University • Edge AI | Computer Vision | Spirituality | Books | Travel •