Whether you’re a data scientist or not, you’ve probably interacted with time series data at some point in your life. In plain language, time series data is simply a dataset that tracks a single point of data over time; everything from weather records to stock prices qualify as time series data. If you work in data science, it’s essential to learn this type of data sequence that’s so pervasive across industries and in our daily lives.
In this article, we’ll walk you through the basics of time series data, how it’s analyzed, and various real-life examples. Here’s what we’ll cover:
- What is time series data?
- What are the components of time series data?
- What are irregular time series?
- What are some examples of time series data?
- What is the difference between time series data and cross-sectional data?
- What is time series analysis used for?
- What is time series forecasting?
- Key takeaways and next steps
So: what is time series data and time series analysis? Let’s find out.
1. What is time series data?
Time series exist all around us—in both data science and in the everyday world. At its essence, time series data is data that is recorded over regular intervals or time periods. Any non-stationary value that is dependent on time can be part of a time series.
As a data analyst, you can use time series data to discover underlying trends or causes of certain patterns over time.
If the concept sounds familiar, that’s because you’ve probably referred to time series data in your everyday life without even knowing it! Whether you’ve used a smartwatch to track your steps over a period of a week, or written your expenses every day over a month, you’ve successfully recorded time series data.
2. What are the components of time series data?
Any time series dataset can include one or more of the following four components:
- Trend: A trend refers to a long-term and consistent upward or downward movement in a series. Unlike seasonal variation, a trend is unexpected and not immediately identifiable. A trend in which we can find the cause is called deterministic, while a trend that is unexplainable is called stochastic. For example, if a new author releases a book and the book skyrockets in sales, such a trend would be deterministic.
- Cycle: A cycle is an up and down movement that occurs around a trend. Unlike seasonal variation, a cycle does not have a precise and equal time between time periods, and is therefore not predictable.
- Seasonality: Unlike a trend, seasonality refers to variations that occur at a predictable and fixed frequency. For example, ice cream sales rise in the summer because the weather is warmer and more people crave a cool, sweet treat.
- Irregularity: Also referred to as noise, irregularity is what’s left over when you take seasonality or trends out of the dataset. Irregularities are random and unpredictable. A prime example of irregular variations are changes in stock prices.
By identifying these components within a dataset, you can perform transformations and adjustments—one of the most common of which is seasonal adjustments—that lead to more accurate forecasting (which we’ll explore later in this article).
3. What are irregular time series?
When values are gathered at equal and consistent time intervals, the time series is referred to as regular.
But when the measurements are gathered at unpredictable and irregular intervals, the time series is referred to as irregular. For example, a sensor on a phone records information only when the device is picked up, or an ATM logs withdrawals as they occur. These are both examples of irregular time series data. While challenging, it is still possible to model irregular time series data using various methods like neural ordinary differential equation models or interpolation networks.
4. What are some examples of time series data?
Our personal and work lives are rife with examples of time series data.
In the world of business, for one, entrepreneurs track changes in profits, returns, or sales over a year. If you work in investing, on the other hand, you might keep a record of GDP, earnings, or stock prices.
Perhaps some of the most common examples of time series today are: daily stock prices, daily temperatures, the number of people vaccinated on a given day, or the percentage of people unemployed in a given month.
5. What is the difference between time series data and cross-sectional data?
It’s easy to spot a time series, as it consists of just two elements: a time period that is equal and clearly defined, and a single value tracked at the end of each of those time periods.
On the other hand, cross-sectional data consists of several variables tracked during a single, fixed period of time—for example, the average income of several cities during a single year, or a survey of a population. In cross-sectional data, the focus is more on a comparison of various entities, and less on analyzing data over time in order to make forecasts.
Of course, it’s also possible to combine time series data and cross-sectional data. Such a new dataset is referred to as panel data. With panel data you could, for example, track the effect of social benefits on unemployment over a period of time.
6. What is time series analysis used for?
Generally, time series analysis consists of observing data points and all their variations (or components) across a period of time.
By observing past data, analysts can make intelligent conclusions regarding behavior across industries, including business, finance, real estate, and retail, then use that information to make future decisions (also known as time series forecasting).
Time series analysis can be used to:
- Make decisions about future values, based on past values. For example, you could set retail prices for swimsuits based on seasonal variations in time series data
- Forecast future values, based on past values. For example, you could forecast general temperatures based on decades of weather records
- Pinpoint irregularities or noise in time series. For example, you could detect fraudulent financial activity based on historical financial activity.
Time series analysis can be especially conducive for anyone working in a role that necessitates making decisions and planning policies.
7. What is time series forecasting?
Time series forecasting is a type of time series analysis that looks at historical data to choose a model for forecasting future data. The more holistic the data, the more accurate the forecast will be.
For example, a time series of cars purchased over the last 50 years might yield more precise forecasts than a time series of cars purchased over the last two years. Time series forecasting is a central use of time series data, and often the primary one.
And, within forecasting, you can either choose to analyze a single variable to predict future values (referred to as univariate time series forecasting), or use multiple variables to forecast them (referred to as multivariate time series forecasting).
8. Key takeaways
In this post, we learned what time series data is, looked at some real-world examples of time series data, and explained how time series analysis is used. Here is a summary of key takeaways:
- Time series data is data that is recorded over regular intervals or time periods
- One or more of four components make up time series data: a trend, a cycle, seasonality, and irregularities
- Time series analysis can be used to pinpoint irregularities, understand past outcomes, make decisions about future values, or forecast values
- The primary function of time series data is to make predictions about future values, also known as time series forecasting
Related viewing: Descriptive Statistics & Exploratory Data
If you’re new to the world of data, we can recommend trying your hand at a free, 5-day introductory data analytics short course. Keen to learn more about data analytics? Check out these guides: