Skip to main content

Time Series Analysis

What is a Time Series?

A time series is a sequence of observations on a variable recorded at regular, ordered points in time — for example, annual GDP, monthly Consumer Price Index (CPI) inflation, quarterly industrial output, or daily stock-index closing values. Formally we write the series as Y1,Y2,,Yt,,YnY_1, Y_2, \dots, Y_t, \dots, Y_n, where the subscript tt denotes the time period.

Time series differ from cross-sectional data in one crucial way: the ordering matters, and successive observations are usually correlated (this quarter's GDP depends heavily on last quarter's). This dependence over time is what the whole subject sets out to model.

The two broad objectives are:

  1. Description / decomposition — separating the series into interpretable parts (trend, seasonal, cyclical, irregular).
  2. Forecasting — using the observed pattern and the correlation structure to predict future values.

The Classical Components of a Time Series

The classical model treats an observed series as the combination of four components:

ComponentSymbolMeaningExample (Indian economy)
TrendTtT_tLong-run direction (upward/downward) over many periodsSteady rise in India's nominal GDP over decades
SeasonalStS_tFixed-period fluctuations that repeat within a yearFoodgrain arrivals peaking after the kharif and rabi harvests
CyclicalCtC_tWave-like movements longer than a year, tied to the business cycleBoom–slowdown phases of industrial output
IrregularItI_tRandom, unpredictable residual variationOutput shock from a sudden policy change or a natural calamity

These combine in one of two standard ways:

  • Additive model: Yt=Tt+St+Ct+ItY_t = T_t + S_t + C_t + I_t — used when the seasonal swing is roughly the same absolute size regardless of the level of the series.
  • Multiplicative model: Yt=Tt×St×Ct×ItY_t = T_t \times S_t \times C_t \times I_t — used when the seasonal swing grows proportionally as the trend rises (common for economic series measured in rupees). Taking logs converts a multiplicative model into an additive one.

Estimating the Trend: Moving Averages

A moving average (MA) smooths out short-term seasonal and irregular movements to reveal the underlying trend. A simple kk-period moving average replaces each observation with the mean of itself and its neighbours:

\text{MA}_t = \frac{Y_{t-m} + \dots + Y_t + \dots + Y_{t+m}}{k}, \quad k = 2m+1
  • Choose the span kk equal to the length of the seasonal cycle so the seasonal effect averages out — e.g. a 4-period MA for quarterly data, a 12-period MA for monthly data.
  • When kk is even (4 or 12), the average falls between two time points, so a centred moving average (a further 2-period average of the moving averages) is used to re-align it with the original periods.

Worked idea: for quarterly data, first compute the 4-quarter MA, then centre it. The centred MA is the estimated trend-cycle Tt^\hat{T_t}. Dividing (multiplicative model) or subtracting (additive model) the original series by this trend isolates the seasonal-plus-irregular part.

An alternative to a plain moving average is fitting a trend by least squares — e.g. a linear trend Yt^=a+bt\hat{Y_t} = a + bt or an exponential/log-linear trend lnYt=a+bt\ln Y_t = a + bt, where bb measures the average growth per period.

Isolating and Removing Seasonality

Once the trend is estimated, seasonal behaviour is summarised by seasonal indices:

  1. Detrend the series (divide by the centred MA under a multiplicative model).
  2. For each season (each quarter or each month), average the detrended values across all years.
  3. Scale these averages so they sum to the number of seasons (4 for quarterly, 12 for monthly) — these are the seasonal indices.

An index of, say, 1.15 for a given quarter means that quarter typically runs 15% above the trend level. Seasonal adjustment — dividing each observation by its seasonal index — produces a "seasonally adjusted" series (the kind of figure statistical agencies report so that genuine changes are not confused with predictable seasonal swings).

Stationarity — The Central Concept

Most forecasting methods require the series to be stationary. A series is (weakly/covariance) stationary if its statistical properties do not change over time:

  • constant mean,
  • constant variance, and
  • an autocovariance between YtY_t and YthY_{t-h} that depends only on the lag hh, not on where in time we are.

Economic series in levels (GDP, price index, money supply) are almost always non-stationary — they trend upward and their variance grows. Two remedies are common:

  • Differencing: work with the change ΔYt=YtYt1\Delta Y_t = Y_t - Y_{t-1} rather than the level. First differencing removes a linear trend; a series that becomes stationary after dd differences is said to be integrated of order dd, written I(d)I(d). Many macro series are I(1)I(1).
  • Log transformation: taking logs stabilises a variance that grows with the level; the first difference of a log series, ΔlnYt\Delta \ln Y_t, approximates the growth rate.

Testing for stationarity. Two standard checks:

  • Inspect the autocorrelation function (ACF): for a non-stationary series the autocorrelations decay very slowly; for a stationary series they die out quickly.
  • Apply a unit-root test such as the Augmented Dickey–Fuller (ADF) test. The null hypothesis is that a unit root is present (the series is non-stationary); rejecting it supports stationarity.

Autocorrelation

The autocorrelation at lag hh measures the correlation of the series with its own past:

\rho_h = \frac{\text{Cov}(Y_t, Y_{t-h})}{\text{Var}(Y_t)}

The ACF (all ρh\rho_h plotted against hh) and the partial autocorrelation function (PACF) are the primary diagnostic plots used to choose a model — the shape of these plots tells you how many lag terms a model needs.

Forecasting Models

Once a series is made stationary, several standard models can be fitted:

  • Autoregressive, AR(pp): the current value is a linear function of its own pp past values plus a random error: Yt=c+ϕ1Yt1++ϕpYtp+εt.Y_t = c + \phi_1 Y_{t-1} + \dots + \phi_p Y_{t-p} + \varepsilon_t.
  • Moving-average, MA(qq): the current value depends on the current and qq past random shocks: Yt=μ+εt+θ1εt1++θqεtq.Y_t = \mu + \varepsilon_t + \theta_1 \varepsilon_{t-1} + \dots + \theta_q \varepsilon_{t-q}.
  • ARIMA(p,d,qp,d,q): combines autoregression and a moving-average of the errors on a series that has been differenced dd times. This is the workhorse univariate forecasting model. SARIMA adds seasonal terms for data like monthly IIP or CPI.
  • Exponential smoothing: forecasts as a weighted average of past observations with weights declining geometrically; Holt's method extends this to a trend and Holt–Winters to trend plus seasonality.

The usual workflow (the Box–Jenkins approach) is: identify the model from ACF/PACF and stationarity tests → estimate the parameters → check the residuals (they should behave like white noise) → forecast, and evaluate accuracy with measures such as RMSE, MAE, or MAPE on held-out data.

Worked Illustration: India's GDP Growth Rate

Consider India's annual real GDP growth rate:

YearGDP Growth Rate
20158.0%
20168.3%
20176.8%
20186.5%
20193.9%
  • A 3-year moving average smooths the year-to-year noise: the average of 2015–2017 is (8.0+8.3+6.8)/37.7%(8.0+8.3+6.8)/3 \approx 7.7\%, and of 2016–2018 is (8.3+6.8+6.5)/37.2%(8.3+6.8+6.5)/3 \approx 7.2\% — showing a mild downward drift in the trend across the second half of the decade.
  • This is an annual series, so there is no within-year seasonal component; seasonality would appear if we instead used quarterly GDP.
  • The growth-rate series is itself a transformation (the log-difference) of the GDP-level series — a common way to convert a trending, non-stationary level into something closer to stationary.

(Growth figures vary across data vintages and base-year revisions; treat these numbers as illustrative rather than definitive.)

Why This Matters for Indian Economic Data

  • Monsoon seasonality: agricultural output and rural demand follow the kharif/rabi cycle, so agricultural and food-price series must be seasonally adjusted before month-on-month changes can be read meaningfully.
  • Structural breaks: one-off events — a major policy shift, a global shock, or a pandemic — can shift the mean or variance abruptly. Such breaks violate the stationarity assumption and must be handled with dummy variables or by modelling the sub-periods separately, rather than being mistaken for ordinary irregular variation.
  • Revisions and base-year changes: official Indian series (GDP, IIP, CPI) are revised and periodically rebased, so a modeller should note the vintage of the data being used.

Summary

  • A time series is time-ordered, and its observations are correlated over time.
  • The classical decomposition splits a series into trend, seasonal, cyclical and irregular components, combined additively or multiplicatively.
  • Moving averages estimate the trend; seasonal indices isolate and remove seasonality.
  • Most methods require stationarity, achieved by differencing and/or log transformation and checked with the ACF and unit-root (ADF) tests.
  • Forecasting relies on AR, MA, ARIMA/SARIMA and exponential-smoothing models, selected using ACF/PACF diagnostics and validated on their residuals and out-of-sample errors.