Introduction to Time Series
Understand the basics of time series, its main components (trend, seasonal/cyclical, noise), and core analysis and forecasting techniques.
Summary
Read Summary
Flashcards
Save Flashcards
Quiz
Take Quiz
Quick Practice
What is the definition of a time series?
1 of 17
Summary
Introduction to Time Series
Understanding Time Series
A time series is a sequence of observations measured at successive points in time, typically at regular intervals such as daily, monthly, or yearly. Unlike a simple snapshot of data, a time series allows you to observe how a variable changes over time rather than just what its value is at any single moment.
The crucial insight is that the order of observations matters. This is fundamentally different from most data you might have encountered before. In a time series, observations that are close together in time tend to be related to each other. For example, today's temperature is likely similar to tomorrow's temperature, but very different from the temperature six months from now. This property—called temporal dependence—is what makes time series analysis special.
Why Order Matters: Time Series vs. Cross-Sectional Data
Consider two types of data:
Cross-sectional data captures many units at a single point in time. For instance, the heights of students in a classroom recorded on Monday morning. The order you list the students doesn't matter—height doesn't depend on whether you measure student A before or after student B.
Time series data, by contrast, tracks one or more variables over time. The temperature readings in a city measured every day for a year form a time series. Here, order is everything: you can't scramble the readings randomly without losing important information.
Components of a Time Series
Most time series can be decomposed into distinct components, each capturing different patterns in the data:
Trend represents the long-term direction of movement in the data. This could be a steady increase (like population growth in a country over decades) or a decrease (like declining usage of a technology). The trend captures the "big picture" direction over an extended period.
Seasonality refers to regular, repeating patterns that occur within a fixed period. These cycles return consistently—perhaps annually, quarterly, or even daily. For example, electricity demand is typically higher during summer months and lower during winter, and this pattern repeats every year. Retail sales spike around the winter holidays. These predictable patterns tied to calendar periods define seasonality.
Cyclical fluctuations are longer-term waves that are not tied to a fixed calendar period. Business cycles are the classic example: economies expand and contract, but the length of each cycle varies. A cycle might last several years, and you can't predict exactly when the next peak or trough will occur just from knowing the date.
Irregular or noise component captures random variations that don't fit the other patterns. These are sudden shocks or unexplained variations—like a temporary factory shutdown, an unusual weather event, or measurement error. This component represents what we can't explain with trend, seasonality, or cyclical patterns.
The image above shows a real example: tuberculosis deaths over time (top), with the series decomposed into trend (showing the overall decline), yearly changes (seasonality), and percent change.
Tools for Time Series Analysis
Visual Exploration
The first step in analyzing any time series is to plot it. A visualization reveals trends, seasonal patterns, outliers, and structural breaks at a glance. Looking at the raw data helps you ask better questions and understand what analysis techniques might be appropriate.
Smoothing Techniques
Moving averages are a simple but powerful tool. The basic idea is to replace each observation with the average of that observation and its neighbors. For example, a 3-point moving average replaces each value with the mean of that value and the two adjacent values. This smoothing reduces noise and makes underlying patterns clearer, like wiping fog off a window to see the landscape beneath.
Decomposition Methods
Decomposition formally separates a time series into its constituent components: trend, seasonal, and irregular. This technique gives you estimates of each component, allowing you to study them separately. If you have a time series $yt$ at time $t$, decomposition might express it as:
$$yt = \text{Trend}t + \text{Seasonal}t + \text{Irregular}t$$
This is incredibly useful for understanding which patterns dominate your data and for removing seasonality if you want to focus on trend.
Fundamental Forecasting Models
The Naïve Forecast
The simplest possible forecasting model is the naïve forecast, which predicts that the next value will be exactly the same as the last observed value:
$$\hat{y}{t+1} = yt$$
While simplistic, the naïve forecast often serves as a useful benchmark. If your sophisticated model doesn't beat the naïve forecast, something is wrong.
Simple Exponential Smoothing
Simple exponential smoothing is a more refined approach that updates forecasts based on the current observation and the previous forecast. The updating formula is:
$$St = \alpha Xt + (1-\alpha) S{t-1}$$
where:
$St$ is the smoothed value (or forecast) at time $t$
$Xt$ is the actual observation at time $t$
$\alpha$ is the smoothing parameter, a number between 0 and 1
$S{t-1}$ is the smoothed value from the previous time period
The smoothing parameter $\alpha$ controls how much weight you give to recent observations versus past history. If $\alpha = 1$, you only look at the current observation. If $\alpha = 0$, you ignore the current observation entirely and stick with past forecasts. In practice, $\alpha$ values between 0.1 and 0.3 often work well, balancing responsiveness to new information with stability.
Autoregressive Integrated Moving Average (ARIMA)
The ARIMA model is a powerful and flexible framework that combines three components to capture different aspects of time series behavior:
Autoregressive (AR) terms use past values of the series to forecast future values, based on the idea that a series has momentum or persistence.
Integrated (I) terms involve differencing—computing changes between consecutive observations. This transformation helps stabilize a series that has a trend, converting it into a stationary series (one with constant mean and variance over time).
Moving Average (MA) terms model the dependency of current values on past forecast errors, capturing how recent shocks propagate through the system.
ARIMA models are denoted as ARIMA$(p,d,q)$, where $p$ is the number of autoregressive terms, $d$ is the degree of differencing, and $q$ is the number of moving average terms. This framework can represent a wide variety of time series patterns, from simple random walks to complex cyclical behavior.
<extrainfo>
Cyclical Components (More Detail)
While cyclical fluctuations are mathematically similar to seasonal patterns, they differ fundamentally in one key way: cyclical patterns have no fixed period. Unlike seasonality, which repeats on a predictable calendar schedule, cycles can vary in length. This makes cyclical patterns harder to model and forecast precisely. In many analyses, cyclical components are included in either the trend or irregular component rather than treated separately.
Transformation Methods
When working with time series, you sometimes need to transform the data before analysis. For example, if variance increases over time, taking logarithms or square roots can stabilize it. The image below shows how different transformations affect data shape:
Each transformation curve has different properties: linear transformations do nothing, square root and logarithmic transformations compress large values more than small ones, while exponential transformations do the opposite.
</extrainfo>
Flashcards
What is the definition of a time series?
A sequence of data points collected at successive points in time, usually at regular intervals.
Why is the order of observations essential in a time series?
Because data points close in time tend to be more related than points far apart.
How does a time series differ from a single snapshot of a variable?
It allows for the observation of how a variable changes over time.
What is the primary focus of cross-sectional data?
Differences between multiple units at a single point in time.
In terms of observation order, how does cross-sectional data differ from time series data?
The order of observations is irrelevant in cross-sectional data.
What does the concept of temporal dependence imply in time series analysis?
The value at one time point provides information about values at nearby time points.
What are the four primary components that make up a time series?
Trend
Seasonal
Cyclical
Irregular (or Noise)
In time series analysis, what does the Trend component represent?
A long-term upward or downward movement in the series.
What is the definition of the Seasonal component in a time series?
Regular, repeating patterns that occur within a fixed period.
How are Cyclical fluctuations distinguished from Seasonal components?
They are longer waves that are not tied to a fixed calendar.
What characterizes the Irregular or Noise component of a time series?
Random variations that cannot be explained by trend, seasonality, or cycles.
How do moving averages help in visualizing the underlying trend of a time series?
By smoothing the data through the averaging of neighboring observations.
Which specific parts is a time series separated into during decomposition?
Trend
Seasonal
Residual (irregular)
What is the prediction logic used in a naïve forecasting model?
The next value is predicted to be the same as the last observed value.
What is the formula for Simple Exponential Smoothing?
$St = \alpha Xt + (1-\alpha) S{t-1}$ (where $St$ is the forecast, $Xt$ is the current observation, and $\alpha$ is the smoothing parameter).
In Simple Exponential Smoothing, what is the valid range for the smoothing parameter $\alpha$?
Between 0 and 1.
What three elements are combined in a basic Autoregressive Integrated Moving Average (ARIMA) model?
Autoregressive terms
Differencing (to achieve stationarity)
Moving-average terms
Quiz
Introduction to Time Series Quiz Question 1: Unlike a single snapshot, what does a time series allow?
- Observing how a variable changes over time (correct)
- Comparing different units at one point in time
- Estimating static population parameters
- Measuring a constant, unchanging quantity
Introduction to Time Series Quiz Question 2: In cross‑sectional data, the order of observations is...
- Irrelevant (correct)
- Crucial for analysis
- Determinative of temporal dependence
- Reflective of seasonal cycles
Introduction to Time Series Quiz Question 3: Which component of a time series represents long‑term upward or downward movement?
- Trend component (correct)
- Seasonal component
- Cyclical component
- Irregular component
Introduction to Time Series Quiz Question 4: Which component consists of longer waves not tied to a fixed calendar?
- Cyclical component (correct)
- Seasonal component
- Trend component
- Irregular component
Introduction to Time Series Quiz Question 5: In a naïve forecasting model, the forecast for the next period is ...
- Equal to the last observed value (correct)
- The average of all past values
- Zero
- The extrapolated trend value
Unlike a single snapshot, what does a time series allow?
1 of 5
Key Concepts
Time Series Concepts
Time series
Trend (time series)
Seasonality
Cyclical component
Irregular component (noise)
Temporal dependence
Time Series Analysis Techniques
Moving average (smoothing)
Time series decomposition
Simple exponential smoothing
ARIMA model
Data Types
Cross‑sectional data
Definitions
Time series
A sequence of data points collected at successive, equally spaced points in time, used to analyze temporal patterns.
Cross‑sectional data
Data collected at a single point in time across multiple subjects or units, focusing on differences rather than temporal changes.
Temporal dependence
The property that observations close in time are more likely to be related than those farther apart, influencing forecasting.
Trend (time series)
The long‑term upward or downward movement in a time‑series dataset, reflecting persistent changes over time.
Seasonality
Regular, repeating patterns in a time series that occur within a fixed period, such as daily, monthly, or yearly cycles.
Cyclical component
Fluctuations in a time series that occur over longer, non‑fixed periods, often associated with economic or business cycles.
Irregular component (noise)
Random, unpredictable variations in a time series that cannot be explained by trend, seasonality, or cycles.
Moving average (smoothing)
A technique that averages neighboring observations to reduce short‑term fluctuations and highlight underlying trends.
Time series decomposition
The process of separating a series into its constituent components: trend, seasonal, and irregular (residual).
Simple exponential smoothing
A forecasting method that updates predictions using a weighted average of the most recent observation and the previous forecast.
ARIMA model
Autoregressive Integrated Moving Average, a statistical model combining autoregression, differencing, and moving‑average terms to forecast non‑stationary time series.