# Time Series Analysis, Simply Explained

#49 May 5, 2025 Foundation

https://www.aibutsimple.com/p/time-series-analysis-simply-explained

Time series analysis is a statistical technique that involves data collected at regular intervals over time to uncover patterns, trends, and structures. This particular type of data is called a time series, and it is sequential. Some examples of time series include the daily weather, monthly revenue, or yearly GDP growth rates.

The primary goals of time series analysis include understanding the data, fitting models for forecasting, analysis, and monitoring or controlling processes.

Time series analysis typically relies on statistical and machine learning models, but deep learning models may also be applied.

- The “go-to” neural network for time series analysis is one that works well for sequence modeling: the recurrent neural network (RNN). Standard RNNs and specialized ones (such as the LSTM) are both common.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/dbab1727-5efe-4b91-a615-65ca6fec5258/Copy_of_CV_illust__1_.png)

Unlike some other data analysis methods (such as linear regression), time series analysis focuses on how the data changes over time, making it useful for understanding how variables evolve and for forecasting future values.

It is widely applied in fields such as weather forecasting, finance, economics, and healthcare for informed decision-making and predictions. After all, time series data is extremely abundant in just about any field.

---

Big thanks to our partners for keeping this newsletter free. If you have a second, clicking the ad below helps us a ton—and who knows, you might find something you’ll enjoy.

### You Don’t Need to Be Technical. Just Informed

[![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/4d1c3ea6-ee41-40d1-8e57-312c2b3b85de/2.png)](https://www.theaireport.ai/welcome-page)

AI isn’t optional anymore—but coding isn’t required.

[The AI Report](https://www.theaireport.ai/welcome-page) gives business leaders the edge with daily insights, use cases, and implementation guides across ops, sales, and strategy.

Trusted by professionals at Google, OpenAI, and Microsoft.

👉 Get the newsletter and make smarter AI decisions.

[Lead with AI—no coding needed](https://www.theaireport.ai/welcome-page)

---

Time series data have components and properties that describe their shape and behavior. These properties are targeted by time series models and will be carefully analyzed to draw conclusions or forecast data.

### Time Series Components

Components are the building blocks of a time series. They are distinct, interpretable elements that combine to form an overall pattern. There are four main ones: trend, seasonality, cyclicality, and irregular/random variation.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/99bdbd90-e8a1-4d8a-a870-a6d6d3029403/image.png)

#### Trends

Trends are long-term movements or general directions in the data, either upward, downward, or flat. They can be linear, indicated by a constant rate of change, or nonlinear, which is indicated by non-constant rates of change (accelerating/decelerating).

Identifying the time series’ trend is essential for analysis; it shows the data’s overall direction, which tells the model where its forecast should be headed. It’s useful in long-term forecasting and separating structural growth from temporary fluctuations.

#### Seasonality

Seasonality represents periodic fluctuations that occur at regular intervals, such as monthly or quarterly patterns. For example, retail sales often peak in December due to the holiday season.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/0a528eca-0e8b-4977-9ca8-bb66b4a85edc/image.png)

Seasonality can be detected using run sequence plots, seasonal subseries plots, box plots, and many other methods.

- A run sequence plot (also called a time series plot or run chart) is a type of graph used to display data points in the order they were collected. It is just another way of describing a regular time series graph.

There are two main types of seasonality: fixed or changing. Fixed or deterministic seasonality has a constant seasonal pattern. It recurs in a predictable way, both in intensity and periodicity.

- The level of the seasonal pattern stays the same over the same seasonal period.
- The location of the peaks and troughs does not vary. In other words, the time steps between each repetition of the pattern are constant.

Sometimes, seasonal patterns change significantly over several periods. A changing or stochastic seasonality evolves over consecutive seasonal periods (like year over year). The intensity is less predictable, but the periodicity stays roughly the same.

We can combine seasonal effects with other components such as the trend. If we add a constant seasonal effect to the trend, we call it an additive seasonality. If we scale the seasonal effect with the trend, we call it a multiplicative seasonality.

#### Cyclicality

Cyclicality refers to repeating patterns or fluctuations that occur over longer, irregular periods (usually years) and are not tied to the calendar. It is unlike seasonality, which arises over regular, predictable time intervals based on the calendar.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/71b477ad-e068-45c2-8b42-604c7ee6b93f/image.png)

Cycles are usually influenced by economic, political, or natural cycles such as the business cycle. For instance, the economy might follow a long, multi-year cycle due to varying demand, interest rates, and market activity. Detecting cycles requires specific domain knowledge or additional techniques such as filtering and smoothing.

#### Irregular or Random Variation

Irregular variation, also called residuals or noise, is unpredictable, non-repeating small changes after trend, seasonality, and cycles are removed. These variations might be caused by random events like natural disasters or public sentiment.

Some types of irregular variation include white noise, outliers, and measurement errors.

Although irregularity is not modeled, they are important as they determine the level of predictability. High levels of irregular variation indicate that the data has lower predictability, and vice versa.

### Time Series Properties

Properties are statistical characteristics that describe how the data behaves over time, usually used to assess a model.

#### Autocorrelation

Autocorrelation is a statistical property that measures the correlation between a time series and its lagged values (past values), indicating how much the current data depends on the past data.

When performing autocorrelation analysis, we look for a pattern over the time series. For example, the temperatures on different days may be autocorrelated, or today’s stock price may be correlated with yesterday’s price.

Autocorrelation at some amount of lag is computed using the Pearson correlation coefficient between the time series and a version of itself shifted some amount of time steps.

This way, autocorrelation can range between -1 and 1. Values above 0 are considered positive autocorrelation, and values below 0 are considered negative autocorrelation.

- Positive autocorrelation generally means that the time series tends to continue in the same direction, while negative autocorrelation means that the series reverses direction.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/d3222c33-51bc-4c63-b28d-f6f6a59dd405/image.png)

The autocorrelation function (ACF) measures the total correlation between a value and its lagged values. This includes both direct and indirect effects in the form of intermediate lags.

ACF plots visually show autocorrelation coefficients across a range of lags. Large spikes at specific lags may suggest a trend, periodicity, or even seasonality. Additionally, if autocorrelations decline slowly over time, the series may have a trend and be non-stationary.

Besides the autocorrelation function, there is the partial autocorrelation function (PACF), which measures the direct correlation between a specific value and a lagged value, without the effects of the intermediate lags.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/16f9061b-a7f1-4775-b07c-8ee1b603e0e5/image.png)

#### Stationarity

A time series is stationary if its statistical properties remain constant over time. These properties include the mean, variance, and autocorrelation.

A stationary series appears flat, without trends or seasonality. It can be assessed easily using a run sequence plot.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/e0a75684-afc6-4e4c-95bc-8241e4f03698/Copy_of_Copy_of_Copy_of_CV_illust__1_.png)

Stationarity is important and a requirement for many models, as it ensures that the data’s behavior is predictable. Non-stationary data can be transformed into stationary data with differencing, transformations, or trend removal.

- To difference data, we subtract each data point from its previous value.
- We can apply transformations to the data (like logarithms or square roots) to stabilize variance.
- Trend removal is the process of fitting a curve to the time series and analyzing residuals, which are the differences between the predicted value and the actual value.

---

### The Fastest Way To Do Research.

[Otio](https://otio.ai/?ref=simpleai&utm_source=newsletter.aibutsimple.com&utm_medium=referral&utm_campaign=time-series-analysis-simply-explained) helps you store all your files and extract insights from them instantly.

Plus, you can create AI agents to execute your repetitive tasks without code. Otio is loved by 200,000 professionals around the world.

[Try Otio today!](https://otio.ai/?ref=simpleai&utm_source=newsletter.aibutsimple.com&utm_medium=referral&utm_campaign=time-series-analysis-simply-explained)

---

### Time Series Models

To actually make predictions or obtain useful information from time series, we need a model to fit to the data. Here are some common ones.

#### ARIMA (AutoRegressive Integrated Moving Average)

ARIMA is a powerful model for forecasting time series data that combines autoregressive modeling, differencing, and moving average components.

- An autoregressive model is one that forecasts future values based on past values.
- Differencing is a technique that is used to make a non-stationary time series stationary. This makes up the “I” in ARIMA, with the word “integrated” representing differencing.
- Moving average refers to a technique used to smooth out short-term variability and highlight trends. There are different types of moving averages: simple, weighted, and exponential.

The components that make up the functionality of ARIMA also make up its name: “AR” for autoregressive, “I” for integrated, and “MA” for moving average.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/67f5185b-baf3-490d-bed2-565aca810124/dbsdadas.png)

The ARIMA model is defined by three parameters (p, d, and q), and it is denoted as ARIMA(p, d, q). ARIMA modeling typically follows this approach:

We first check for stationarity by plotting and using statistical tests such as the KPSS. We must ensure that the series’ mean and variance do not change over time—ARIMA requires the data to be stationary.

If the data is not stationary, apply differencing (d) by subtracting each value from its previous value. Repeatedly difference (increase the d value) until the series is stationary—typically d = 1 or 2 is enough.

We find good starting p and q values by plotting the autocorrelation function (ACF) and partial autocorrelation function (PACF) of the differenced series. This can be done in a multitude of ways; here’s a common approach:

- For an AR(p) process, the PACF shows large spikes up to lag p and then drops off, while for an MA(q) process, the ACF shows large spikes up to lag q and then drops off.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/ed28885e-7a8c-44fd-b7cc-96f4a2a2da0b/image.png)

To fit the model, we typically use [maximum likelihood estimation (MLE)](https://online.stat.psu.edu/stat415/lesson/1/1.2?utm_source=newsletter.aibutsimple.com&utm_medium=referral&utm_campaign=time-series-analysis-simply-explained). After fitting, we check residuals for white noise by plotting. The residuals should show no significant autocorrelation, indicating a good fit.

Forecasting with ARIMA is also quite simple: the next timestep can be calculated using an equation involving the AR and MA components along with some model parameters. We compute the next timestep, and then the next, and the next, recursively to forecast as many steps as we need.

The ARIMA model has successors such as SARIMA (Seasonal ARIMA) or SARIMAX (Seasonal ARIMA with external factors), which add additional functionality like seasonality and external factors.

The ARIMA model is debated on whether or not it should be classified as a machine learning algorithm. Most analysts typically won’t consider it as such, since ARIMA was established before the ML boom that defined classification and neural networks.

We can also use other well-known machine learning techniques for time series analysis. As classic ML techniques are not directly suited for time series, we can use feature engineering to adapt the data to a supervised learning problem.

#### Random Forest

Random forests are ensemble learning models that use the concept of “power in numbers” to handle relationships. They are made up of many decision trees, another ML model, and use either majority voting or averaging to obtain the final decision.

They can be adapted to incorporate lagged variables and external features, making them useful for complex time series.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/e0c4e478-a44f-4f65-afbd-057a06beb608/image.png)

#### Support Vector Machines (SVMs)

Support vector machines (SVMs) are a popular class of model in standard machine learning applications, but they can be used for time series regression or classification by mapping data to higher dimensions. They are effective for small datasets but less common due to computational complexity.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/1b204f25-99c0-4fac-916c-bbc87cb4637b/image.png)

#### Recurrent Neural Networks (RNNs)

For a deep learning approach, Recurrent Neural Networks (RNNs)—a specialized type of neural network designed to process sequential data—can be used.

The key feature of RNNs that differentiates them from regular neural networks is their ability to maintain a hidden state that captures information from previous time steps, effectively creating a form of memory.

This memory helps it capture patterns and relationships in sequences, making RNNs suitable for time series analysis in tasks like predicting future values of stock prices or weather conditions.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/e0feda37-b376-49c4-91b5-d281a14d7206/Copy_of_Copy_of_CV_illust__3_.png)

Additionally, RNNs can handle varying lengths of inputs (up to a decently high range), accommodating irregularly spaced time intervals and adapting to different forecasting tasks.

Want to learn more about RNNs and how they work? Check out our previous issue detailing RNNs [here](https://www.aibutsimple.com/p/recurrent-neural-networks-simplified?utm_source=newsletter.aibutsimple.com&utm_medium=referral&utm_campaign=time-series-analysis-simply-explained).

However, standard RNNs have their limitations, primarily the vanishing or exploding gradient problem—affecting their ability to model relationships between variables for longer sequences.

#### Transformers

The transformer’s sequence-handling ability also makes it a good fit for time series applications.

Originally developed for natural language processing (NLP), transformers have been adapted for time series forecasting.

The Temporal Fusion Transformer (TFT) combines the transformer architecture with other components to handle multivariate time series, incorporating temporal self-attention mechanisms to focus on relevant time steps.

![](https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,width=1200,format=auto,onerror=redirect,quality=80/uploads/asset/file/8c622b57-3637-4dd0-aa8a-6656ffd3d7e7/image.png)

A sample TFT architecture.

- Here, the attention mechanism is adapted to work for time series data, assigning importance to certain data points over time.

---

Here’s a special thanks to our [biggest supporters](https://www.aibutsimple.com/upgrade?utm_source=newsletter.aibutsimple.com&utm_medium=referral&utm_campaign=time-series-analysis-simply-explained):

Sushant Waidande

---

If you enjoy our content, consider supporting us so we can keep doing what we do. Please share this with a friend!

Want to reach 50000+ ML engineers? Let’s work together:

[WORK WITH US 📈](https://www.passionfroot.me/aibutsimple?utm_source=newsletter.aibutsimple.com&utm_medium=referral&utm_campaign=time-series-analysis-simply-explained)

Feedback, inquiries? Send us an email at [edwin@aibutsimple.com](mailto:edwin@aibutsimple.com).

If you like, you can also donate to our team to push out better newsletters every week!

[Support us ☕](https://ko-fi.com/aibutsimple?utm_source=newsletter.aibutsimple.com&utm_medium=referral&utm_campaign=time-series-analysis-simply-explained)

---

That’s it for this week’s issue of AI, but simple. See you next week!

—AI, but simple team
