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 , where the subscript 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:
- Description / decomposition — separating the series into interpretable parts (trend, seasonal, cyclical, irregular).
- 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:
| Component | Symbol | Meaning | Example (Indian economy) |
|---|---|---|---|
| Trend | Long-run direction (upward/downward) over many periods | Steady rise in India's nominal GDP over decades | |
| Seasonal | Fixed-period fluctuations that repeat within a year | Foodgrain arrivals peaking after the kharif and rabi harvests | |
| Cyclical | Wave-like movements longer than a year, tied to the business cycle | Boom–slowdown phases of industrial output | |
| Irregular | Random, unpredictable residual variation | Output shock from a sudden policy change or a natural calamity |
These combine in one of two standard ways:
- Additive model: — used when the seasonal swing is roughly the same absolute size regardless of the level of the series.
- Multiplicative model: — 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 -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 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 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 . 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 or an exponential/log-linear trend , where measures the average growth per period.
Isolating and Removing Seasonality
Once the trend is estimated, seasonal behaviour is summarised by seasonal indices:
- Detrend the series (divide by the centred MA under a multiplicative model).
- For each season (each quarter or each month), average the detrended values across all years.
- 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 and that depends only on the lag , 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 rather than the level. First differencing removes a linear trend; a series that becomes stationary after differences is said to be integrated of order , written . Many macro series are .
- Log transformation: taking logs stabilises a variance that grows with the level; the first difference of a log series, , 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 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 plotted against ) 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(): the current value is a linear function of its own past values plus a random error:
- Moving-average, MA(): the current value depends on the current and past random shocks:
- ARIMA(): combines autoregression and a moving-average of the errors on a series that has been differenced 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:
| Year | GDP Growth Rate |
|---|---|
| 2015 | 8.0% |
| 2016 | 8.3% |
| 2017 | 6.8% |
| 2018 | 6.5% |
| 2019 | 3.9% |
- A 3-year moving average smooths the year-to-year noise: the average of 2015–2017 is , and of 2016–2018 is — 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.