Temporal Patterns, Decomposition, and StationarityIntroductionTime-series forecasting begins before a forecasting model is fitted. The analyst must first understand how observations evolve through time. A sales series may rise because of long-term market growth, fluctuate systematically by month, respond to business cycles, or contain unexplained shocks. These features are not interchangeable: each implies different diagnostics, transformations, and modelling choices. This chapter develops a systematic foundation for examining temporal structure. It explains trend, seasonality, cycles, autocorrelation, and irregular variation; introduces graphical and numerical diagnostics; presents classical decomposition and STL; and develops transformation, differencing, and stationarity concepts. The chapter concludes with a business application showing how these tools guide forecasting decisions. Learning ObjectivesBy the end of this chapter, you should be able to: - Distinguish trend, seasonality, cycles, autocorrelation, and irregular variation.
- Use time plots, seasonal plots, moving averages, and rolling statistics to diagnose temporal structure.
- Explain additive and multiplicative decomposition and apply classical decomposition conceptually.
- Describe STL decomposition and identify its advantages and limitations.
- Select transformations and differencing operations appropriately.
- Explain weak stationarity and its importance in forecasting.
- Interpret the ACF and PACF and use statistical tests such as ADF, KPSS, and Phillips–Perron tests responsibly.
- Translate diagnostic evidence into defensible modelling and managerial decisions.
1. The Anatomy of a Time SeriesA time series is a sequence of observations ordered in time, conventionally denoted by yt, where t identifies the observation period. The spacing between observations should normally be regular—for example, hourly, daily, monthly, or quarterly—unless a method explicitly accommodates irregular timestamps. A useful conceptual representation is: yt = Tt + St + Ct + Rt where Tt is trend, St is seasonal variation, Ct is cyclical variation, and Rt is irregular or remainder variation. This additive representation assumes that components are measured in the same units and combine through addition. In a multiplicative representation: yt = Tt × St × Ct × Rt The multiplicative form is appropriate when the magnitude of fluctuations increases with the level of the series. Taking logarithms converts it into an additive form, provided observations are positive: ln(yt) = ln(Tt) + ln(St) + ln(Ct) + ln(Rt) These equations are conceptual decompositions rather than claims that the components are uniquely identifiable. Different decomposition methods may allocate variation differently, particularly when trend and cycle evolve gradually. TrendTrend is the persistent long-run direction of a series. It may be linear, nonlinear, piecewise, or eventually saturating. A trend does not require every observation to increase or decrease; short-term reversals are compatible with an underlying trend. Examples include population growth, declining unit costs, and expanding digital subscriptions. SeasonalitySeasonality is a regular and calendar-related pattern that repeats with a known period. Monthly retail sales may have a 12-month seasonal period; hourly electricity demand may have daily and weekly seasonal periods. Seasonality must be distinguished from a one-time event. A holiday effect that recurs annually is seasonal, whereas a single product launch is not. CyclesA cycle is a medium- or long-term fluctuation without a fixed, known period. Economic expansions and recessions are common examples. Cycles differ from seasonality because their duration and amplitude may vary. In practice, separating a slowly changing trend from a long cycle can be difficult and often depends on the forecasting horizon and business context. AutocorrelationAutocorrelation is dependence between observations separated by a lag. If high values tend to follow high values, or low values follow low values, nearby observations are positively autocorrelated. Negative autocorrelation occurs when observations tend to alternate. Autocorrelation may arise from trend, seasonality, delayed effects, inventory adjustments, or genuine serial dependence. Therefore, autocorrelation is a statistical property, not a separate substantive component like trend or seasonality. Irregular variationIrregular variation is the residual movement not explained by systematic components. It includes measurement noise, unexpected demand shocks, strikes, extreme weather, and data errors. A remainder series should not automatically be interpreted as pure white noise; unexplained structure in the remainder indicates an incomplete decomposition or inadequate model. 2. Graphical DiagnosisA time plot should be the first diagnostic. Plot observations against time, preserve the correct chronological order, label units, and mark relevant interventions. The analyst should examine: - changes in level or slope;
- increasing or decreasing variance;
- repeated peaks and troughs;
- abrupt outliers or intervention effects;
- missing values and irregular spacing;
- long runs above or below a central level.
A seasonal plot places observations from each seasonal cycle on a common horizontal scale. For monthly data, the x-axis may show January through December, with one line per year. Such a plot reveals whether seasonal effects are stable, evolving, or absent. A month plot or box plot can show differences in seasonal distributions while highlighting outliers. A lag plot compares yt with yt-k for a selected lag k. A strong diagonal pattern suggests dependence. Scatter around a narrow diagonal indicates stronger association than scatter around a broad cloud. Rolling statistics help identify changing behaviour. For a window of width w, a rolling mean is: mt = (1/w) × ∑i=0w-1 yt-i and a rolling variance is: st² = [1/(w−1)] × ∑i=0w-1(yt-i − mt)² These estimates are local summaries, not independent observations. They are useful for visualization but can be unstable near the series boundaries and sensitive to the choice of w. 3. Moving Averages and SmoothingA moving average replaces each observation with an average of nearby observations, reducing short-term noise. A centered moving average of odd order m = 2k + 1 is: MAt = (1/m) × ∑j=-kk yt+j A centered average is aligned with the middle observation and therefore useful for descriptive decomposition. It cannot be computed at the first and last k observations without additional conventions. For even seasonal periods, such as 12 months, a two-stage centered moving average is commonly used: first calculate a 12-term moving average and then average adjacent 12-term values to centre it. This is a smoothing convention, not a universal law. Moving averages are useful for: - revealing broad trend;
- estimating a trend-cycle component;
- reducing high-frequency variation;
- constructing simple baseline forecasts.
They also have limitations. Smoothing can hide turning points, distort end-of-sample behaviour, and remove genuine short-term signals. A moving average should therefore support, not replace, contextual analysis. 4. Classical DecompositionClassical decomposition estimates components in a sequence. For an additive series with seasonal period m, a common procedure is: - Estimate the trend-cycle with a moving average.
- Subtract the estimated trend-cycle from the observations.
- Estimate seasonal indices by averaging detrended values for each season.
- Centre or normalize seasonal indices as required.
- Obtain the remainder by subtracting estimated trend and seasonality.
For additive seasonality, the seasonal indices should sum approximately to zero across one complete seasonal cycle: ∑j=1m Sj = 0 For multiplicative seasonality, the indices should average approximately one: (1/m) × ∑j=1m Sj = 1 The normalization ensures that the seasonal component does not change the overall level. Classical decomposition is transparent and easy to communicate, but it has important limitations: it usually assumes stable seasonal patterns, uses fixed smoothing rules, handles endpoints poorly, and is sensitive to outliers. Worked example: additive seasonal indicesSuppose quarterly sales, after removal of the estimated trend-cycle, produce the following detrended values: | Quarter | Detrended values | Average |
|---|
| Q1 | −18, −22 | −20 | | Q2 | 8, 12 | 10 | | Q3 | 25, 21 | 23 | | Q4 | −7, −5 | −6 |
The indices sum to −20 + 10 + 23 − 6 = 7, not zero, because of finite-sample estimation and uneven residual effects. A centred normalization subtracts the mean index, 7/4 = 1.75, from every index. The normalized indices are −21.75, 8.25, 21.25, and −7.75, which sum to zero. These values mean that Q1 is estimated to be 21.75 units below the trend-cycle, whereas Q3 is 21.25 units above it. The interpretation assumes additive units, such as thousands of units sold. 5. STL DecompositionSTL—Seasonal-Trend decomposition using Loess—uses locally weighted regression, commonly called LOESS, to estimate seasonal and trend components flexibly. It repeatedly smooths the series and updates the components. A conceptual additive form is: yt = Tt + St + Rt STL is especially useful when seasonality changes gradually over time or when the trend is nonlinear. Robust STL can reduce the influence of outliers by assigning them lower weights during iterative fitting. Compared with classical decomposition, STL generally offers: - flexible, evolving seasonality;
- nonlinear trend estimation;
- robust treatment of unusual observations;
- explicit control over smoothing windows.
However, STL is not automatically superior. Results depend on choices such as seasonal and trend window lengths, the degree of robustness, and the assumed seasonal period. STL also describes historical structure; it does not by itself produce a complete forecast model. The extracted components must be forecast or incorporated into a forecasting method. A practical principle is to choose smoothing windows using domain knowledge and out-of-sample validation rather than selecting them solely to create an attractive historical plot. 6. Transformations and DifferencingTransformationsA transformation can stabilize variance or make relationships more nearly additive. Common choices include: - logarithm: zt = ln(yt) for positive observations;
- square root: zt = √yt for non-negative count-like data;
- Box–Cox transformation.
The Box–Cox family is: zt(λ) = (yt^λ − 1)/λ, λ ≠ 0 with the limiting case: zt(0) = ln(yt) where λ is selected or specified, and yt > 0. A transformation changes the scale and therefore affects interpretation. If forecasts are transformed back, simply exponentiating a mean log forecast may underestimate the mean on the original scale when errors are non-negligible. Bias adjustment may be required. DifferencingFirst differencing removes changes in level: ∆yt = yt − yt−1 Seasonal differencing with period m removes repeated seasonal levels: ∆m yt = yt − yt−m A combination is: ∆∆m yt = (1 − B)(1 − Bm)yt where B is the backshift operator defined by Byt = yt−1. Expanding gives yt − yt−1 − yt−m + yt−m−1. Differencing should be used only as much as necessary. Over-differencing can create unnecessary noise, induce negative autocorrelation, and reduce forecast quality. Differencing differs from detrending. Detrending estimates and removes a trend function; differencing removes changes between observations. A deterministic linear trend can sometimes be handled by regression with a time variable, whereas stochastic trend behaviour often motivates differencing. 7. StationarityA weakly, or covariance-, stationary series has a constant mean, constant finite variance, and autocovariance that depends only on lag rather than calendar time. If μ is the mean and γk is the autocovariance at lag k, then: E(yt) = μ Var(yt) = σ² < ∞ Cov(yt, yt−k) = γk for all relevant times t. A strictly stationary process has an unchanged joint distribution under time shifts; weak stationarity is the more commonly used practical concept. Stationarity matters because many statistical relationships and forecasting models assume that the underlying dependence structure is stable. A series with a changing mean or variance may produce misleading correlations, unstable parameter estimates, and unreliable significance tests. Stationarity does not mean that observations are independent, nor does it mean that the series is constant. A stationary autoregressive process can fluctuate substantially while maintaining stable probabilistic properties. Unit roots and stochastic trendsA simple random walk is: yt = yt−1 + εt where εt is a zero-mean innovation with constant variance and no serial correlation. Its variance increases with time, so the process is non-stationary. First differencing produces ∆yt = εt, which is stationary under the stated assumptions. A deterministic trend and a unit-root process are not equivalent. Both can appear non-stationary in a plot, but their responses to shocks differ. A shock to a deterministic-trend process may be temporary, whereas a shock to a unit-root process can have a permanent effect. 8. ACF and PACFThe autocorrelation function (ACF) at lag k is: ρk = γk/γ0 where γ0 is the variance. The sample ACF estimates this relationship from observed data. The partial autocorrelation function (PACF) measures the association between yt and yt−k after accounting for intermediate lags 1 through k−1. Typical diagnostic patterns are useful but not definitive: | Pattern | Possible interpretation |
|---|
| ACF decays very slowly | Non-stationarity or strong persistence | | ACF has seasonal spikes | Seasonal dependence | | ACF cuts off after lag q | Possible moving-average structure | | PACF cuts off after lag p | Possible autoregressive structure | | Both decay gradually | Mixed dynamics or non-stationarity | | ACF near zero at all non-zero lags | Possible white noise |
For a white-noise series of length n, approximate individual ACF standard errors are often 1/√n, but this is a rough guide and depends on assumptions. Confidence bands should not be treated as a mechanical model-selection rule. Trend and seasonality can generate large ACF values even when no meaningful short-memory model remains after appropriate adjustment. 9. Statistical Tests for StationarityAugmented Dickey–Fuller testThe ADF test examines a unit-root null hypothesis using a regression such as: ∆yt = α + βt + γyt−1 + ∑i=1p ψi∆yt−i + εt where the constant α, optional deterministic trend βt, and lagged differences control for deterministic structure and serial correlation. The null is typically γ = 0—a unit root—against a stationary alternative. Critical values are non-standard, so ordinary t-test critical values are inappropriate. KPSS testThe KPSS test reverses the usual framing: its null is level stationarity or trend stationarity, depending on specification, against a non-stationary alternative. Using ADF and KPSS together can provide more informative evidence than either alone, but conflicting outcomes are possible because tests have limited power and respond differently to structural breaks and sample size. Phillips–Perron testThe Phillips–Perron test also tests a unit-root null but uses non-parametric corrections for serial correlation and heteroskedasticity rather than adding a chosen number of lagged differences in the same way as ADF. No test can prove stationarity in a finite sample. Results depend on sample length, lag selection, deterministic terms, outliers, and structural breaks. A break in level or trend can cause a stationary series to appear unit-root non-stationary. Test results should therefore be interpreted alongside plots, domain knowledge, ACF/PACF behaviour, and forecast validation. 10. A Diagnostic WorkflowA disciplined workflow is more reliable than applying tests in isolation: - Verify timestamps, frequency, units, duplicates, missing values, and revisions.
- Plot the raw series and annotate interventions, policy changes, promotions, and unusual events.
- Examine seasonal plots, rolling mean and variance, and relevant lag plots.
- Decide whether a transformation is needed to stabilize variance.
- Inspect ACF and PACF of the raw and transformed series.
- Assess stationarity using visual evidence and complementary tests.
- Difference only when justified; reassess the differenced series.
- Decompose with classical decomposition or STL when component interpretation is useful.
- Fit candidate forecasting models to the training data.
- Inspect residuals and evaluate forecasts on a temporally ordered holdout or rolling-origin evaluation.
The final decision should be driven by both statistical adequacy and business usefulness. A slightly less accurate model may be preferable if its seasonal adjustments and drivers are transparent and operationally actionable. Applied Case: Forecasting Monthly Hospital Emergency AdmissionsBackgroundThis illustrative case concerns a regional hospital whose operations team must forecast monthly emergency admissions for staffing and bed-capacity planning. Five years of monthly data are available. Admissions rise gradually over time, show winter peaks, and display greater absolute variation in later years. ProblemThe team initially fits a forecasting model directly to the raw series. Forecast errors are large during winter, and residual plots show changing variance. Managers ask whether the issue is poor model choice or inadequate understanding of temporal structure. AnalysisThe time plot indicates an upward trend and recurring annual seasonality. A seasonal plot shows that winter peaks have become larger in absolute terms as total admissions have grown. This suggests multiplicative rather than constant-amplitude seasonality. A log transformation is therefore considered. The transformed series has a more stable spread. The ACF of the log series remains high at small lags and shows peaks around lag 12, indicating persistence and annual seasonality. The rolling mean continues to rise, so the series is not yet plausibly stationary. ADF fails to reject a unit-root null, while KPSS rejects stationarity. Although neither result is decisive, both support further investigation. STL on the log scale reveals a smooth upward trend, evolving winter effects, and several unusual months associated with an influenza outbreak. Robust STL assigns reduced influence to those outliers. The remainder is substantially less structured than the original series, although a small lag-1 correlation remains. Approach and solutionThe team uses seasonal differencing at lag 12, followed by ordinary differencing only if required by the chosen model. Candidate models are compared using rolling-origin validation rather than random train-test splitting, which would leak future information into the training process. Forecasts are transformed back to the admissions scale with appropriate bias adjustment and are reported with prediction intervals. The operational dashboard presents both the forecast and its components: baseline trend, expected winter effect, and uncertainty. An outbreak indicator is added for scenario analysis rather than allowing an exceptional historical event to define normal seasonality. OutcomeThe revised process reduces winter forecast error and improves staffing decisions. More importantly, managers understand why demand rises: long-run growth, recurring winter seasonality, and occasional shocks are shown separately. The hospital does not treat the decomposition as causal proof; it uses it as a structured descriptive aid and combines it with epidemiological information. Learning points- Variance and seasonal amplitude should be assessed before model fitting.
- Log transformation can make proportional changes easier to model, but forecasts must be carefully back-transformed.
- Robust decomposition helps prevent isolated outbreaks from becoming permanent seasonal patterns.
- Unit-root tests complement, but do not replace, graphical and operational evidence.
- Time-ordered validation is essential when evaluating forecasts.
Challenges, Governance, and Contemporary PracticeDecomposition can create false confidence when components are interpreted as objectively existing entities rather than estimated constructs. Analysts should document the frequency, missing-data treatment, transformation, decomposition method, smoothing windows, outlier policy, and test specifications. Forecasting systems should preserve data lineage and record revisions. Sensitive applications—health, credit, employment, and public services—require privacy protection, access controls, and monitoring for systematic error across demographic or geographic groups. A seasonal pattern may reflect unequal access or institutional scheduling rather than an immutable demand law. Modern forecasting platforms increasingly combine STL-like feature extraction with automated model selection, gradient boosting, and neural networks. These tools can discover nonlinear interactions, but they do not eliminate the need for temporal validation, leakage prevention, explainability, and stability monitoring. AI-generated forecasts should be treated as decision support, not as an unquestionable substitute for domain expertise. Best Practices- Start with a correctly indexed and documented time plot.
- Separate calendar effects from one-off events.
- Use transformations when variation grows with the level, not merely because they are conventional.
- Avoid automatic repeated differencing.
- Use ACF, PACF, and tests as mutually informing evidence.
- Inspect decomposed remainders for remaining structure.
- Validate all choices using future-like data splits.
- Communicate uncertainty and the limits of causal interpretation.
- Reassess components after structural changes, policy interventions, or major shocks.
Chapter SummaryTemporal analysis identifies the structure that forecasting models must represent. Trend describes persistent direction; seasonality repeats at a known calendar frequency; cycles fluctuate over less predictable durations; autocorrelation captures dependence across lags; and irregular variation contains shocks and unexplained noise. Time plots, seasonal plots, rolling statistics, lag plots, and moving averages provide essential first evidence. Classical decomposition is transparent but relatively rigid. STL uses local smoothing and can represent evolving trend and seasonality more flexibly, including robust treatment of outliers. Transformations can stabilize variance, while ordinary and seasonal differencing can remove changing levels and recurring seasonal levels. Stationarity concerns stable distributional properties, not absence of movement. ACF and PACF reveal dependence patterns, and ADF, KPSS, and Phillips–Perron tests provide complementary—but imperfect—evidence. The central professional principle is diagnostic discipline: understand the data-generating context, use multiple forms of evidence, avoid over-differencing and overinterpretation, and validate every forecasting decision on temporally appropriate future-like observations. Key TermsTrend: Persistent long-run movement in a time series. Seasonality: A recurring pattern with a known calendar-related period. Cycle: A fluctuation whose duration is not fixed or known in advance. Autocorrelation: Dependence between observations at different time lags. Irregular variation: Unsystematic residual movement, including shocks and noise. Additive decomposition: A representation in which components are summed. Multiplicative decomposition: A representation in which components are multiplied. Moving average: A local average used to smooth observations. Classical decomposition: A fixed, sequential trend and seasonal extraction procedure. STL: Seasonal-Trend decomposition using locally weighted regression. LOESS: Local polynomial smoothing using nearby observations and weights. Transformation: A mathematical re-expression used to alter scale or variance behaviour. Differencing: Subtracting a lagged observation to remove changing levels. Seasonal differencing: Subtracting the observation from the previous seasonal cycle. Stationarity: Stability of relevant probabilistic properties over time. Unit root: A non-stationary dynamic feature associated with persistent shocks. ACF: Autocorrelation function indexed by lag. PACF: Partial autocorrelation after controlling for intermediate lags. ADF test: Unit-root test with augmented lagged differences. KPSS test: Test whose null hypothesis is stationarity. Review Questions5 Short Answer Questions- Distinguish seasonality from cycles.
- Why can a logarithmic transformation be useful for a series whose variability increases with its level?
- What does first differencing calculate?
- Define weak stationarity.
- Why should a remainder series be inspected after decomposition?
5 Long Answer Questions- Explain the additive and multiplicative decomposition frameworks, including when each is appropriate.
- Compare classical decomposition and STL in terms of flexibility, robustness, endpoint behaviour, and interpretation.
- Explain how ACF and PACF assist in diagnosing temporal dependence.
- Discuss why ADF, KPSS, and Phillips–Perron test results should not be interpreted mechanically.
- Develop a complete diagnostic workflow for a monthly business time series with trend, changing variance, and suspected seasonality.
3 Analytical / Application Questions- A retailer’s monthly sales show an upward trend and seasonal peaks that become larger in absolute magnitude each year. Recommend a transformation and decomposition approach, and justify your choices.
- A series has a slowly decaying ACF, an ADF test that does not reject a unit root, and a KPSS test that rejects stationarity. Explain the evidence and propose the next diagnostic steps.
- A hospital’s demand series contains a one-time epidemic spike. Explain how treating that spike as ordinary seasonality could damage forecasts, and design an evaluation and modelling strategy to address it.
Multiple Choice Questions with AnswersQuestion 1Which feature is defined by a known and repeating calendar period? A. Cycle B. Seasonality C. Irregular variation D. Unit root Correct Answer: B. Seasonality Question 2For a centered moving average of odd order m = 2k + 1, which expression is correct? A. (1/m) × ∑ from j = 0 to k of y(t+j) B. (1/k) × ∑ from j = −k to k of y(t+j) C. (1/m) × ∑ from j = −k to k of y(t+j) D. (1/(m−1)) × ∑ from j = −k to k of y(t+j) Correct Answer: C. (1/m) × ∑ from j = −k to k of y(t+j) Question 3In an additive decomposition, seasonal indices across one complete seasonal cycle should approximately: A. Sum to zero B. Average to zero and sum to one C. Sum to the trend value D. Average to zero only when the series is multiplicative Correct Answer: A. Sum to zero Question 4Which is a principal advantage of robust STL? A. It guarantees stationary residuals B. It removes the need for forecast validation C. It reduces the influence of outliers during component estimation D. It requires no choice of smoothing parameters Correct Answer: C. It reduces the influence of outliers during component estimation Question 5Seasonal differencing with period m is calculated as: A. y(t) − y(t−1) B. y(t) + y(t−m) C. y(t)/y(t−m) D. y(t) − y(t−m) Correct Answer: D. y(t) − y(t−m) Question 6Which statement best describes weak stationarity? A. Every observation is identical B. The mean and variance are constant and autocovariance depends only on lag C. All observations are independent D. The series contains no seasonal pattern by definition Correct Answer: B. The mean and variance are constant and autocovariance depends only on lag Question 7The usual null hypothesis of the ADF test is that the series: A. Has a deterministic seasonal component B. Is white noise C. Contains a unit root D. Has constant variance only Correct Answer: C. Contains a unit root Question 8If a stationary series of length n is approximately white noise, a rough standard-error scale for an individual sample ACF is: A. n B. √n C. 1/n² D. 1/√n Correct Answer: D. 1/√n Question 9A slowly decaying ACF in the raw series may indicate: A. Non-stationarity or strong persistence B. Certain absence of autocorrelation C. Only measurement error D. That differencing is never appropriate Correct Answer: A. Non-stationarity or strong persistence Question 10Why is random train-test splitting usually inappropriate for evaluating time-series forecasts? A. It always produces too few observations B. It can allow future information to influence training C. It prevents calculation of the ACF D. It forces multiplicative decomposition Correct Answer: B. It can allow future information to influence training
|