Welcome to the first lesson of your course on Deep Learning for Time series Forecasting! I'm excited to guide you on this journey. Our goal is to build your expertise from the ground up, moving from fundamental concepts to building and deploying advanced forecasting models.
This initial module, "Time Series Fundamentals," lays the essential groundwork. In this lesson, we will focus on the most basic but crucial topic: defining what time series data is and identifying its core characteristics. Mastering these concepts is the first step toward understanding, analyzing, and ultimately forecasting this unique type of data.
What is Time Series Data?
At its core, time series data is a sequence of observations recorded at regular time intervals. The crucial elements are that the data points are ordered by time and are typically collected at a consistent frequency (e.g., hourly, daily, monthly).
Think about data you might encounter in your projects or interests:
- Finance: The daily closing price of a stock.
- IoT: Temperature readings from a sensor every minute.
- Energy: Hourly electricity consumption for a city.
- Web Analytics: The number of visitors to a website each day.
- Cybersecurity: The number of login attempts on a server per second.
In each case, the data isn't just a collection of numbers; its value is intrinsically linked to the timestamp at which it was recorded.
For a brief and clear introduction, please watch the first two minutes of the following video from IBM Technology. It provides a simple definition and some practical examples.
This video from IBM Technology provides a concise definition of time series data and illustrates its applications across different industries.
Watch the video from the beginning until the 01:57 mark. Focus on the core definition of time series data and the examples provided.
The Four Core Components of a Time Series
To analyze time series data effectively, we often "decompose" it into its constituent parts. This helps us understand the underlying structure of the data. Almost any time series can be described as a combination of four components:
- Trend
- Seasonality
- Cyclicity
- Noise (also called Irregularity or Residual)
The image below provides a great visual summary of what each of these components looks like.

Now, let's explore each of these components in more detail. The second half of the IBM Technology video you started provides a great high-level overview of these.
Continuing with the same video, this next segment introduces the four components of a time series: trend, seasonality, cycle, and variation (noise).
Watch the video from 02:15 to 03:54. Pay attention to the simple explanations and visual cues for each component.
1. Trend
The trend represents the long-term movement or general direction of the data. It shows whether the series is increasing, decreasing, or staying relatively constant over an extended period. For instance, the global demand for data storage has shown a consistent upward trend for decades, while the use of coal for energy in some regions shows a downward trend.
A trend doesn't have to be linear. It can be non-linear (curved) as well. The following article from GeeksForGeeks provides excellent visual examples of different trend types. You don't need to run the code, but observing the plots will solidify your understanding.
Components of Time Series Data
This article from GeeksForGeeks, titled 'Components of Time Series Data', visually demonstrates different types of trends you might encounter.
Read the section titled '1. Trend'. Focus on the definition and, most importantly, examine the plot that shows upward, downward, horizontal, non-linear, and damped trends.
2. Seasonality
Seasonality refers to repeating patterns or fluctuations that occur at fixed and known intervals. These patterns are predictable and are usually tied to a calendar or clock—for example, daily, weekly, or yearly cycles.
- Example: Retail sales often show yearly seasonality, with peaks during the holiday season in December and troughs in January/February.
- Example: Urban traffic data might exhibit daily seasonality (peaks during morning and evening commutes) and weekly seasonality (less traffic on weekends).
The key aspect of seasonality is its fixed period. If the pattern repeats every 12 months, its period is 12. If it repeats every 24 hours, its period is 24.
3. Cyclicity
Cyclicity also refers to repeating patterns of ups and downs, but unlike seasonality, these patterns occur over irregular and non-fixed intervals. Cycles are typically longer in duration than seasonal patterns and are often associated with broader economic or business conditions.
- Example: The business cycle of economic expansion and recession is a classic example of cyclicity. A recession might occur every 5-10 years, but the exact duration and timing are not predictable in the way a seasonal holiday peak is.
The key difference: Seasonality has a fixed and known frequency (e.g., every 24 hours, every 7 days, every 12 months), while the frequency of a cycle is variable and unknown.
4. Noise (Irregularity / Residual)
Noise is the random, unpredictable variation in a time series that cannot be explained by the trend, seasonality, or cyclicity. It's the residual component left over after we account for the other systematic patterns. This randomness can be due to measurement errors or unforeseen events.
In an ideal forecasting model, the goal is to capture all the systematic patterns (trend, seasonality, cyclicity) so that the only thing remaining—the model's errors, or residuals—is unpredictable noise. This concept will become very important later when we evaluate our models.
For a more formal definition of noise, please read the following section from an OpenStax textbook. It introduces the important concept of "white noise," which is a foundational idea in time series analysis.
5.2 Components of Time Series Analysis
This excerpt from the 'Principles of Data Science' textbook on OpenStax provides a clear definition of noise and introduces the statistical properties of 'white noise'.
Read the section titled 'Noise and Random Variation'. Focus on understanding what noise represents and the three key characteristics of white noise (constant zero mean, constant variance, uncorrelated).
Test your understanding!
For each of the following scenarios, which of the four components (Trend, Seasonality, Cyclicity, Noise) would you most expect to be significant? (More than one may apply).
- Monthly sales data for a new, popular video game console over three years. The console is in high demand and its production is scaling up.
- Hourly electricity usage in a residential neighborhood.
- The number of sunspots observed annually since the year 1700. Sunspot activity is known to rise and fall over a period of roughly 11 years, but it's not exact.
- The difference (error) between your weather app's daily temperature forecast and the actual measured temperature.
Show answer
- Trend: You would expect a strong upward trend as production scales and popularity grows. Seasonality: You'd likely see yearly seasonality with a significant spike in sales during the holiday season (Nov-Dec).
- Seasonality: This is the dominant component. You would expect strong daily seasonality (lower usage overnight, peaks in the morning and evening) and weekly seasonality (different patterns on weekdays vs. weekends).
- Cyclicity: This is a classic example of a cyclical pattern. The period is not fixed at exactly 11 years, making it a cycle, not a seasonal pattern.
- Noise: Ideally, the errors of a good forecasting model should resemble random noise. There shouldn't be any predictable patterns left. If you found, for example, that the error was always positive in winter and negative in summer, it would indicate the model failed to capture the seasonal pattern correctly.
How Components Combine: A Quick Preview
Finally, it's useful to know that these components are typically combined in one of two ways to form the observed time series:
-
Additive Model:
Time Series = Trend + Seasonality + Noise- In this model, the magnitude of the seasonal and noise components are independent of the trend. The seasonal fluctuations are roughly constant regardless of whether the trend is high or low.
-
Multiplicative Model:
Time Series = Trend * Seasonality * Noise- Here, the magnitude of the seasonal and noise components are proportional to the trend. As the trend increases, the seasonal fluctuations and random variations become larger. This is common in economic data, like retail sales, where the dollar-value fluctuation during Christmas is much larger today than it was 30 years ago.
We will explore these models and how to perform decomposition practically in a future lesson. For now, just be aware that these are the two fundamental ways of thinking about how a time series is constructed.
Key Takeaways and Next Steps
Congratulations on completing your first lesson! You've learned the fundamental building blocks of all time series analysis.
- Time Series Data is a sequence of data points indexed in time order and collected at regular intervals.
- The four key components are:
- Trend: The long-term direction.
- Seasonality: Patterns that repeat at fixed time intervals.
- Cyclicity: Patterns that repeat at non-fixed time intervals.
- Noise: The random, unpredictable remainder.
In our next lesson, we will move from theory to practice. You will learn how to load, explore, and manipulate time series datasets using the pandas library in Python, setting the stage for our first visualizations and analyses.