Time Series Analysis: Trend, Seasonality, ARIMA Basics
A time series is data recorded in time order — daily temperatures, monthly sales, yearly GDP. Time series analysis studies how such data evolves so you can understand its patterns and forecast the future. It is the statistics of "what happens next".
This matters because nearly every important number arrives as a time series: stock prices, website traffic, electricity demand, disease cases. Organisations that read these patterns well stock the right inventory, staff the right shifts, and invest at the right time; those that do not are perpetually surprised.
Key Concepts
- Trend (T): the long-term direction — steadily rising smartphone adoption, slowly falling birth rates.
- Seasonality (S): fixed-period repeating patterns — ice-cream sales peaking every summer, retail spiking every December.
- Cyclical (C): longer, irregular waves such as business cycles of boom and recession spanning years.
- Irregular (I): the leftover noise — strikes, pandemics, one-off events no pattern explains.
- Stationarity: a series whose mean and variance stay constant over time — the required starting point for ARIMA modelling.
- ARIMA(p, d, q): AutoRegressive (p: uses past values), Integrated (d: differences taken to achieve stationarity), Moving Average (q: uses past forecast errors).
Formulas
- Additive decomposition: Y = T + S + C + I — components add up to the observed value.
- Multiplicative decomposition: Y = T × S × C × I — used when seasonal swings grow with the level (typical for sales).
- First differencing: Dt = Yt − Y(t−1) — the change from one period to the next; the simplest way to remove a trend and approach stationarity (d = 1).
- AR(1) model: Yt = c + φ·Y(t−1) + et — today's value depends on yesterday's plus a random shock et.
Assumptions: ARIMA needs stationarity (difference until achieved) and enough history — a rule of thumb is at least 50 observations for reliable estimates.
Worked Example
A shop's quarterly sales (₹ thousands): Q1 80, Q2 100, Q3 130, Q4 90, then next year Q1 88, Q2 110, Q3 143, Q4 99. Decompose it.
- Spot the trend: each quarter beats the same quarter last year (80→88, 100→110, 130→143, 90→99) — roughly 10% annual growth.
- Spot seasonality: within each year the shape repeats: Q3 highest, Q1 lowest — a yearly seasonal cycle.
- Seasonal indices (multiplicative): yearly average ≈ 105; Q3 index ≈ 130/105 ≈ 1.24, Q1 ≈ 80/105 ≈ 0.76.
- Deseasonalise: divide each value by its seasonal index to reveal the clean upward trend underneath.
- Forecast: extend the 10% trend onto last year's same quarter — next Q1 ≈ 88 × 1.10 ≈ 97 (₹ thousand).
- Irregular check: actual vs expected gaps are small here — no shocks to investigate.
Common Misconceptions
- Trend is not seasonality. Trend is the multi-year drift; seasonality is the within-year repeat. Confusing them wrecks forecasts.
- ARIMA does not work on raw trending data. You must difference to stationarity first — that is literally what the "I" stands for.
- Past patterns do not guarantee the future. A structural break (new competitor, new law) invalidates the history the model learned from.
Real-World Applications
- Retail: forecasting Diwali-season demand to stock warehouses months ahead.
- Energy: predicting hourly electricity load, with daily and weekly seasonal cycles.
- Finance: modelling volatility and returns, where ARIMA-family models are industry standard.
- Public health: tracking and projecting disease cases with trend plus weekly reporting seasonality.
Time series analysis is decomposition plus forecasting: split the series into trend, seasonality, cycles, and noise; model each; then reassemble into a prediction. ARIMA adds rigorous machinery, but the core idea — the future rhymes with the past's patterns — stays the same.
Related blogs
- Scatter Diagrams: Reading Correlation from Plots Guide
- Karl Pearson's correlation coefficient Explained with
- Spearman's rank correlation Explained with Examples
- Lines of Regression: Equations with Examples Guide
- Regression Coefficients: Meaning, Formula & Examples
- Analysis of Variance Anova Intro: Explained with Examples