Types of Time Series
Not all time series data behaves the same way. Before analyzing or forecasting, we must understand what type of time series we are dealing with. This decision affects everything — visualization, modeling, and evaluation.
In this lesson, we will classify time series data in a clear, practical way using real-world examples and simple code.
1. Classification Based on Time Index
The most basic way to classify a time series is by how frequently data is recorded.
| Type | Description | Real Example |
|---|---|---|
| Discrete Time Series | Recorded at fixed intervals | Daily stock prices, monthly sales |
| Continuous Time Series | Measured continuously over time | ECG signals, sensor voltage |
In practice, almost all business and ML problems use discrete time series. Continuous series are usually converted into discrete form.
2. Classification Based on Number of Variables
Another important distinction is how many values are recorded at each time step.
| Type | Definition | Example |
|---|---|---|
| Univariate | Single variable over time | Monthly revenue |
| Multivariate | Multiple variables over time | Sales, price, promotions together |
Most beginner problems start with univariate series. Real-world forecasting systems almost always become multivariate.
Example: Univariate Time Series
Let’s create a simple univariate time series representing daily website visits.
import pandas as pd
dates = pd.date_range(start="2023-01-01", periods=7, freq="D")
visits = [120, 135, 150, 160, 155, 170, 180]
ts_uni = pd.Series(visits, index=dates)
print(ts_uni)
2023-01-01 120
2023-01-02 135
2023-01-03 150
2023-01-04 160
2023-01-05 155
2023-01-06 170
2023-01-07 180
Freq: D, dtype: int64
Here, each date has only one value. This is the simplest form of time series.
Example: Multivariate Time Series
Now let’s extend the same example by adding another variable.
import pandas as pd
dates = pd.date_range(start="2023-01-01", periods=7, freq="D")
data = {
"visits": [120, 135, 150, 160, 155, 170, 180],
"ad_spend": [20, 25, 30, 35, 33, 40, 45]
}
ts_multi = pd.DataFrame(data, index=dates)
print(ts_multi)
visits ad_spend
2023-01-01 120 20
2023-01-02 135 25
2023-01-03 150 30
2023-01-04 160 35
2023-01-05 155 33
2023-01-06 170 40
2023-01-07 180 45
Now each time step has two related variables. This allows us to model relationships between inputs and outputs.
3. Classification Based on Behavior
Time series can also be classified based on how they behave over time.
| Behavior | Meaning | Example |
|---|---|---|
| Stationary | Mean and variance stay constant | Sensor noise |
| Non-Stationary | Trend or seasonality present | Sales growth |
Most real-world time series are non-stationary. That’s why later lessons focus heavily on stationarity.
4. Classification Based on Predictability
Some time series are easier to predict than others.
- Deterministic: clear pattern (e.g., sine wave)
- Stochastic: randomness dominates (e.g., stock prices)
Forecasting is about finding signal inside noise.
Where This Matters in Real Projects
- E-commerce sales → multivariate, non-stationary
- Weather data → multivariate, seasonal
- Server CPU usage → univariate, high frequency
- Stock prices → stochastic, noisy
Choosing the wrong model usually starts with misunderstanding the type of time series.
Practice Questions
Q1. Why is multivariate time series more powerful than univariate?
Q2. Which type of time series is most common in business problems?
Quick Quiz
Q. Monthly sales with price and promotion data is an example of?
Lesson Takeaways
- Time series can be classified in multiple ways
- Univariate vs multivariate matters a lot
- Most real data is discrete and non-stationary
- Understanding the type comes before modeling