Time Series

A time series is a sequence of observations indexed by time, \(y_t\) for \(t = 1, 2, \dots, T\). What distinguishes it from an ordinary table of records is that the order carries information: shuffling the rows of a customer table loses nothing, and shuffling a time series destroys the thing being studied.

Observations are usually equally spaced — daily sales, monthly unemployment, hourly temperature, fifteen-minute meter readings — and in practice often are not. Irregular arrivals, missing intervals and changing collection frequency are common, and they constrain which methods apply before any modeling question arises.

What a series is made of

Hyndman and Athanasopoulos name three patterns, and the definitions are worth having exactly rather than approximately.

  • Trend. “A trend exists when there is a long-term increase or decrease in the data. It does not have to be linear.” The last sentence is the one people drop.
  • Seasonal. “A seasonal pattern occurs when a time series is affected by seasonal factors such as the time of the year or the day of the week. Seasonality is always of a fixed and known period.”
  • Cyclic. “A cycle occurs when the data exhibit rises and falls that are not of a fixed frequency. These fluctuations are usually due to economic conditions.”

Anything left over is the remainder — irregular movement the three patterns do not account for.

Cyclic is not seasonal

These two get treated as synonyms, and the same source is blunt about it: “Many people confuse cyclic behaviour with seasonal behaviour, but they are really quite different.” The test is short. “If the fluctuations are not of a fixed frequency then they are cyclic; if the frequency is unchanging and associated with some aspect of the calendar, then the pattern is seasonal.”

Two further properties follow: “the average length of cycles is longer than the length of a seasonal pattern, and the magnitudes of cycles tend to be more variable than the magnitudes of seasonal patterns.” A business cycle runs for years of uncertain length and varies in depth; December runs for one month every year and varies far less.

The practical consequence is about forecasting. A fixed, known period can be projected forward, which is why seasonality is the most reliably forecastable structure a series has — see seasonality. A cycle of unknown length cannot be projected the same way; knowing that downturns recur says nothing about when the next one starts. Treating a cycle as a season produces a forecast that confidently places the next peak on a date the data never supported.

Splitting the series apart

Decomposition writes a series as a combination of a seasonal component \(S_t\), a trend-cycle component \(T_t\) and a remainder \(R_t\). Two forms are standard:

\[ y_t = S_t + T_t + R_t \qquad \text{or} \qquad y_t = S_t \times T_t \times R_t \]

The additive form suits a series where “the magnitude of the seasonal fluctuations, or the variation around the trend-cycle, does not vary with the level of the time series”. The multiplicative form suits one where the seasonal variation “appears to be proportional to the level of the time series”, which is common in economic data — a business three times larger has a December peak three times larger in absolute terms, not the same one. Taking logarithms converts the second case into the first.

Note that trend and cycle are combined into a single component. The reason is practical: separating a slow trend from a long cycle requires assumptions the data rarely settle, so the standard decompositions do not try. Removing the seasonal component gives the seasonally adjusted series, \(y_t - S_t\) additively or \(y_t / S_t\) multiplicatively, which is what official statistics report when they say a figure is seasonally adjusted.

Stationarity, briefly

A series is stationary when “its statistical properties do not depend on the time at which the series is observed”. That is a stronger and cleaner statement than the usual shorthand about constant mean and variance, and it has a consequence that catches people out: a series with cyclic behavior can still be stationary when it has no trend or seasonality, because cycles of no fixed length do not tie the series to a particular starting point. Irregular cycles are compatible with stationarity but do not establish it: the mean, the variance and the dependence between observations must also stay the same wherever you start looking.

Most real series are not stationary, and most classical methods require stationarity, which is why differencing and transformation are the standard first moves. The mechanics, and the autocorrelation diagnostic that goes with them, are covered under ARIMA and temporal autocorrelation.

What gets done with one

QuestionWhat the work looks like
What happens next?Forecasting — see time series forecasting
What is this series made of?Decomposition, seasonal adjustment, trend estimation
Is something wrong right now?Anomaly detection and monitoring, where the baseline must already account for the seasonal pattern
Did this intervention change the series?A causal question, needing a control series or an interrupted-series design rather than a forecast

The fourth row is worth separating from the first. A forecast says what would have happened if nothing changed; comparing it to what did happen is a causal claim that rests on the forecast being right, which is a much stronger assumption than the forecast being useful.

Univariate and multivariate

A univariate series is one variable over time; a multivariate one is several measured together, such as sales alongside temperature and promotion spend. The distinction matters less than it appears, because a univariate model with external regressors sits between them, and most forecasting gains in business settings come from adding a known driver — a price, a promotion calendar, a holiday list — rather than from a more elaborate model of the series alone.

The model families divide along what they assume rather than along their vintage. Classical statistical models such as exponential smoothing and the ARIMA family encode structure directly and come with prediction intervals derived from the model. Regression and tree-based machine learning methods work on engineered features — lags, calendar terms, rolling aggregates — and need that engineering to see structure at all. Sequence models learn the dependence from data and need a great deal of it, which is why they earn their place on many related series rather than on one. Whichever family is chosen, the comparison that decides it is against simple benchmarks on held-out data, which is the subject of naïve baseline forecast.

References


Discover more from Insightful Data Lab

Subscribe to get the latest posts sent to your email.

Similar Posts

Questions, corrections, or additional insights?

This site uses Akismet to reduce spam. Learn how your comment data is processed.