← Back to list

Time Series Forecasting Fundamentals — Part 1

Before building any forecasting model, you need to understand what kind of structure you are dealing with.

Elif Bayındır · 2026-06-05 13:19 · 0 claps · 4.2 min read
#timeseries #time-series-data #data-science #towards-data-science
Open on Medium ↗
Wiki topics: ML · Machine Learning 🔬 · Science · General

Time Series Forecasting Fundamentals — Part 1

Before building any forecasting model, you need to understand what kind of structure you are dealing with.

A time series is simply data ordered in time.

But what makes it different from classical datasets is this:

In many datasets, observations can be independent. In time series, observations are usually dependent on previous values.

Yesterday influences today. This dependency fundamentally changes how we model and forecast such data.

Let’s build intuition step by step.

What Does a Time Series Look Like?

Below is a real-world example: weekly atmospheric CO₂ measurements from the Mauna Loa Observatory (1958–2001).

What do you see?

  • A long-term upward movement.
  • A repeating yearly pattern.

Already, we are observing two fundamental components: trend and seasonality.

Trend

A trend is the long-term increase or decrease in a time series.

It does not have to be linear. Trends can also be exponential, logarithmic, or follow other nonlinear patterns. What matters is not the shape of the curve, but the presence of a sustained long-term directional movement.

Let’s look at an example.

Figure 2. Annual Nile River flow (1871–1912). The series exhibits a sustained downward trend over time.

This series gradually declines over decades. That is a decreasing trend.

If the average level of the series moves upward or downward over time, a trend exists. When a trend is present, the series is usually not stationary.

Seasonality

Seasonality refers to patterns that repeat at fixed intervals.

The key characteristic: The period is constant.

Examples from real life:

  • Ice cream sales increase every summer.
  • Restaurant bookings rise every weekend.
  • Electricity consumption increases every evening.

Let’s look at another dataset that clearly illustrates seasonality.

Figure 3. Monthly airline passenger counts (1949–1960), illustrating a clear annual seasonal pattern with recurring peaks each year.

Passenger volume increases every summer, showing a clear repeating annual seasonal pattern.

Seasonality is often calendar-based. It aligns with time units such as days, weeks, months, or years.

Cycle

A cycle is a pattern of long-term rises and falls in a time series that does not repeat at a fixed or predictable period.

Cycles are often driven by structural forces such as economic crises, political shifts, regulatory changes, or global events like pandemics. They unfold over longer horizons and tend to be stochastic.

Now look at this dataset:

Figure 4. Real private investment (quarterly, billions of dollars), illustrating irregular cyclical fluctuations driven by economic expansions and recessions.

Unlike seasonality, which repeats at fixed calendar intervals, economic cycles are driven by structural forces such as recessions and expansions. In the investment series above, we can observe irregular downturns in the mid-1970s, during the 1980–82 recession, in the early 1990s, and most dramatically during the 2008 financial crisis. These contractions occur at unpredictable intervals and are not tied to the calendar. Instead, they reflect broader economic dynamics unfolding over longer and uncertain horizons. This irregular, non-calendar-based fluctuation is what defines cyclical behavior.

Stationarity

This is one of the most important concepts in time series analysis.

A time series is called stationary if its statistical properties do not change over time.

More precisely:

  • The mean remains constant.
  • The variance remains constant.
  • The covariance structure does not change over time.

Let’s compare visually.

Stationary vs Non-Stationary

Figure 5. Stationary series (constant mean and variance) on the left; non-stationary series (changing mean and variance) on the right.

In the stationary case, the series fluctuates around a stable level. Its average does not drift over time, the variability remains roughly constant, and the overall structure looks similar from beginning to end.

In contrast, the non-stationary series behaves differently. The average gradually shifts upward, the magnitude of fluctuations increases, and the underlying structure evolves over time. Because its statistical properties change, it no longer behaves in a stable way.

This is what we call non-stationary behavior.

A useful intuition:

If the “behavior regime” of the series changes over time, the series is not stationary. When a series is stationary, its future behavior is easier to model — its statistical structure remains stable.

A Small Note on Differencing

If a series is not stationary, one common approach is to look at changes between consecutive observations.

For example, instead of looking at the value on Monday, we look at: Monday − Sunday.

This transformation often removes linear trend components and stabilizes the mean.

This is called taking the first difference. ΔYt=Yt−Yt−1\Delta Y_t = Yt — Y{t-1}

It does not solve everything, but it is often the first step when non-stationarity is observed.

Important nuance: Non-stationary series can still be forecasted.

However, many classical approaches work more reliably once the series is stabilized.

Bringing It All Together

When you look at any time series, ask four questions:

  1. Is there a long-term direction? (Trend)
  2. Does a pattern repeat at fixed intervals? (Seasonality)
  3. Are there longer irregular waves? (Cycle)
  4. Do the statistical properties stay constant? (Stationarity)

These are not modeling techniques. They are diagnostic lenses. Without them, forecasting becomes guesswork.

Next, we will go deeper into one specific concept that sits at the heart of stationarity: Expected Value in Time Series.

You can access the Google Colab notebook used to generate the figures here: 🔗 Open the Colab Notebook


메타데이터
post_id
043339a79e1a
slug
time-series-forecasting-fundamentals-part-1-043339a79e1a
url
https://medium.com/@elif.bayindir1/time-series-forecasting-fundamentals-part-1-043339a79e1a
canonical_url
https://medium.com/@elif.bayindir1/time-series-forecasting-fundamentals-part-1-043339a79e1a
author_url
https://medium.com/@elif.bayindir1
status
ok
fetched_at
2026-06-11 05:11:55