DEV Community

John Kyalo
John Kyalo

Posted on

1 1

The Complete Guide to Time Series Models

Time is the most important factor which ensures success in a business. It is difficult to keep up with the pace of time but through methods of prediction and forecasting such as time series models this is achievable.
It involves working on time-based data to derive hidden insights to make informed decision making. The goal of a time series model is usually to make a forecast for the future.
To be able to come up with a time series model, certain aspects of a time series are considered such as:
Is it stationery?
Is there a seasonality?
Is the target variable autocorrelated?

Moving on, many of the ways to build a model include:
Moving average - it's a model that states the next model is simply the mean of all the past observations.
Exponential smoothing- uses similar logic to moving average but a less importance is assigned to each observation.
Double exponential smoothing- used when there is a trend in the time series.
Triple exponential smoothing- This method extends double exponential smoothing by adding a seasonal smoothing factor. Of course, this is useful if you notice seasonality in your time series.
Seasonal autoregressive integrated moving average (SARIMA.)
Now, SARIMA is the combination of simpler models that create a complex model that can present a time series exhibiting non-stationery properties and seasonality.
It does involve:
the autoregression model AR(p), basically a regression of the time series onto itself.
the moving average model MA(q)
order of integration
then finally seasonality S where S is the season's length.
All this combines to get the SARIMA.

To put this Time Series Models into use, it is applied in:
1) Determining patterns.
2) Detecting anomalies.
3) Forecasting future trends.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more