Time-Series Analysis and ARIMA ModelingIntroductionDemand forecasting is fundamentally a temporal inference problem. Unlike cross-sectional observations, time-series data are ordered: today’s demand may depend on yesterday’s demand, last year’s season, promotions, inventory availability, weather, and changing customer behaviour. This dependence creates both useful structure and statistical risks. A model that ignores temporal dependence may produce biased uncertainty estimates, while a model that mistakes a trend for persistence may generate unreliable forecasts. This chapter develops a systematic approach to time-series analysis for operations managers and business analysts. It examines trend, seasonality, autocorrelation, stationarity, decomposition, transformations, ARIMA and seasonal ARIMA models, residual diagnostics, and time-series cross-validation. The emphasis is not merely on fitting models, but on selecting models that are interpretable, operationally useful, and defensible. Learning ObjectivesBy the end of this chapter, you should be able to: - Distinguish trend, seasonality, cycles, irregular variation, and structural breaks.
- Analyse autocorrelation and explain why stationarity matters.
- Apply additive and multiplicative decomposition and suitable transformations.
- Interpret and specify ARIMA and seasonal ARIMA models.
- Diagnose residuals using statistical and operational criteria.
- Use rolling-origin time-series cross-validation for model comparison.
- Recognise limitations, governance issues, and practical implications of automated forecasting.
1. The Structure of Time-Series DemandLet yt denote observed demand at time t, where observations are equally spaced and measured in consistent units. A time series may contain several components: - Level: the typical magnitude around which observations fluctuate.
- Trend: persistent upward or downward movement.
- Seasonality: a systematic pattern that repeats at a known frequency, such as weekly, monthly, or annual demand.
- Cycle: longer-term oscillation without a fixed or known period, often associated with economic conditions.
- Irregular component: short-term random variation, measurement error, and unanticipated shocks.
- Structural break: a change in the data-generating process, such as a new competitor, pandemic, regulation, or distribution policy.
A useful conceptual decomposition is yt = Tt + St + Rt for an additive model, where Tt is trend, St is seasonality, and Rt is the remainder. The additive form is appropriate when seasonal fluctuations have approximately constant absolute size. A multiplicative decomposition is yt = Tt × St × Rt and is appropriate when seasonal amplitude increases with the level of the series. Because demand is non-negative, the multiplicative structure is often represented through logarithms: ln(yt) = ln(Tt) + ln(St) + ln(Rt) The logarithmic transformation requires yt > 0. If zeros occur, an analyst may use a carefully justified transformation such as ln(yt + c), where c > 0, while recognising that the choice of c affects interpretation. Time-Series Plots and Data QualityAnalysis begins with a plot of the series against time. The analyst should inspect missing observations, duplicate timestamps, changes in measurement units, stockouts, returns, calendar effects, and unusual observations. Observed sales may not equal unconstrained demand: a stockout can produce low sales even when customer demand was high. Promotions can also create temporary spikes that should not automatically be treated as random noise. Time must be represented at an appropriate frequency. Daily data may reveal weekday effects, whereas monthly aggregation may conceal them. Excessive aggregation can remove operationally valuable variation; excessive granularity can create sparse and noisy series. 2. Stationarity and DependenceWeak StationarityA time series is weakly stationary if its probabilistic properties do not change over time. In particular: - The mean is constant: E(yt) = μ.
- The variance is constant and finite: Var(yt) = σ².
- Covariance between two observations depends only on their lag, not on calendar time:
Cov(yt, yt-k) = γk Here, k is the lag and γk is the autocovariance at that lag. Stationarity does not mean that observations are independent. A stationary series may have substantial autocorrelation. Trend, changing variance, evolving seasonal amplitude, and structural breaks are common sources of non-stationarity. Statistical relationships estimated from non-stationary series can appear strong even when no meaningful relationship exists; this is often called spurious regression. AutocorrelationThe autocorrelation function, or ACF, measures linear dependence between observations separated by a lag. The sample autocorrelation at lag k is commonly estimated as rk = [∑t=k+1n(yt − ȳ)(yt−k − ȳ)] ÷ [∑t=1n(yt − ȳ)²] where n is the number of observations and ȳ is the sample mean. The formula is dimensionless because both numerator and denominator have squared demand units. The partial autocorrelation function, or PACF, measures the association between yt and yt-k after controlling for intermediate lags. ACF and PACF plots are useful identification tools, but they do not replace substantive reasoning or out-of-sample evaluation. For approximately white-noise residuals, the Ljung–Box statistic at up to lag h is Q = n(n + 2) ∑k=1h rk² ÷ (n − k) where rk is the residual autocorrelation at lag k. Under suitable large-sample conditions, Q is compared with a chi-square reference distribution, often using degrees of freedom adjusted for estimated model parameters. A small p-value suggests remaining serial dependence. The test should be interpreted alongside residual plots because large samples can make trivial correlations statistically significant. DifferencingFirst differencing removes a stochastic trend when the series is approximately integrated of order one: Δyt = yt − yt−1 Seasonal differencing at period m is Δm yt = yt − yt−m Combined ordinary and seasonal differencing is represented by (1 − B)(1 − Bm)yt where B is the backshift operator, defined by Byt = yt−1. Differencing should be used sparingly. Over-differencing can create unnecessary negative autocorrelation, amplify noise, and damage forecast performance. Stationarity can be assessed through plots, rolling means and variances, ACF behaviour, and formal tests such as the augmented Dickey–Fuller (ADF) and KPSS tests. These tests have different null hypotheses: ADF generally tests a unit-root null, whereas KPSS generally tests a stationarity null. Neither test is infallible, especially in the presence of breaks, short samples, or strong seasonality. 3. Decomposition and TransformationsMoving AveragesA centred moving average smooths short-term variation. For an odd window length m = 2q + 1, the centred average is MAt = (1 ÷ m) ∑j=−qq yt+j It is useful for visualising trend, but it loses observations at the boundaries and should not be confused with a forecasting model. Classical decomposition estimates trend, removes it, estimates seasonal effects, and identifies the remainder. In an additive decomposition, seasonal effects over one complete cycle generally sum approximately to zero. In a multiplicative decomposition, seasonal indices typically average approximately one. Modern decomposition methods, such as STL, use flexible smoothing and can accommodate changing seasonal patterns more effectively than classical decomposition. Variance-Stabilising TransformationsIf variability increases with the level, a logarithm may be suitable: zt = ln(yt) The Box–Cox transformation is zt = (yt^λ − 1) ÷ λ, λ ≠ 0 and zt = ln(yt), λ = 0 where λ is selected, for example, by likelihood-based methods. The transformation requires positive observations. Forecasts on the transformed scale must be carefully returned to the original scale. Simply exponentiating a forecast of ln(yt) estimates the median under a lognormal assumption, not generally the mean. A bias adjustment may be required when the objective is expected demand. 4. ARIMA ModelsAutoregressive ModelsAn autoregressive model of order p, AR(p), expresses the current value as a function of previous values: yt = c + φ1yt−1 + φ2yt−2 + … + φpyt−p + εt where c is an intercept, φi are autoregressive coefficients, and εt is a zero-mean innovation or error. The errors are assumed to be uncorrelated over time, commonly with constant variance, although normality is mainly needed for exact likelihood-based inference rather than for point forecasts. Moving-Average ModelsA moving-average model of order q, MA(q), uses current and past shocks: yt = μ + εt + θ1εt−1 + θ2εt−2 + … + θqεt−q where μ is the mean and θj are moving-average coefficients. The term “moving average” here refers to past errors, not a simple rolling average of observed demand. ARMA and ARIMAAn ARMA(p,q) model applies to a stationary series and combines AR and MA terms. ARIMA(p,d,q) applies ARMA modelling after differencing d times. Using the backshift operator, a compact expression is φ(B)(1 − B)d yt = c + θ(B)εt where φ(B) = 1 − φ1B − … − φpBp and θ(B) = 1 + θ1B + … + θqBq Sign conventions for MA parameters vary across software, so analysts must consult implementation documentation. The innovations should be uncorrelated, have approximately constant variance, and have mean zero. Forecasting can remain valid without normally distributed errors, although non-normality affects prediction intervals and likelihood-based inference. Interpreting ARIMA Orders- p: number of autoregressive terms.
- d: number of ordinary differences.
- q: number of moving-average terms.
A parsimonious model is preferred. Large orders can fit historical noise and produce unstable forecasts. Information criteria such as AIC, AICc, and BIC assist comparison, but they evaluate in-sample likelihood with complexity penalties. The model with the lowest information criterion is not automatically the best operational model; rolling-origin forecast accuracy is also required. 5. Seasonal ARIMASeasonal ARIMA, written SARIMA(p,d,q)(P,D,Q_m), extends ARIMA with seasonal autoregressive, differencing, and moving-average terms at period m. A compact form is φ(B)Φ(Bm)(1 − B)d(1 − Bm)D yt = c + θ(B)Θ(Bm)εt Here, P is the seasonal AR order, D the seasonal differencing order, Q the seasonal MA order, and m the number of observations per seasonal cycle. For monthly data with annual seasonality, m = 12; for daily data with a weekly pattern, m = 7. Multiple seasonalities, such as daily and weekly patterns in hourly data, may require specialised models rather than a standard single-season SARIMA. Seasonal differencing should be used only when needed. Seasonal spikes in the ACF at lags m, 2m, and so forth can indicate seasonal dependence, but calendar effects, holidays, and trading-day variation may be better represented by explanatory variables. 6. A Disciplined Modelling WorkflowA professional workflow is iterative rather than purely automatic: - Define the forecasting target. Specify product, location, horizon, frequency, forecast origin, and whether the target is sales or estimated unconstrained demand.
- Audit the data. Resolve missing periods, stockouts, returns, promotions, outliers, and calendar alignment.
- Plot the series. Inspect level, trend, seasonal amplitude, breaks, and variance.
- Choose transformations. Consider logarithmic or Box–Cox transformations when variance depends on level.
- Assess stationarity. Use substantive knowledge, plots, ACF/PACF, and complementary formal tests.
- Difference only as necessary. Avoid redundant ordinary and seasonal differencing.
- Specify candidate models. Include naïve, seasonal naïve, ETS or decomposition benchmarks, ARIMA, and SARIMA candidates.
- Estimate parameters. Use maximum likelihood or conditional methods and check convergence.
- Diagnose residuals. Examine residual plots, ACF, variance, outliers, and Ljung–Box results.
- Validate out of sample. Use rolling-origin evaluation consistent with the real decision process.
- Select and monitor. Balance accuracy, interpretability, stability, computational cost, and business consequences.
Worked Example: Seasonal Naïve BenchmarkSuppose monthly demand in March is 1,200 units and the forecasting task is April next year. With annual seasonality, the seasonal naïve forecast is ŷt+1 = yt+1−12 Thus, if April demand in the previous year was 1,050 units, the forecast for April this year is 1,050 units. This simple method is difficult to outperform when strong seasonality dominates and should therefore be included as a benchmark. A sophisticated SARIMA model that cannot improve on it in rolling-origin tests may not justify its additional complexity. 7. Residual Diagnostics and Forecast IntervalsLet residuals be et = yt − ŷt for one-step fitted values or appropriately defined forecast errors. A satisfactory model should leave residuals that are approximately uncorrelated, have stable variance, and exhibit no systematic pattern. Residual means should be near zero, although finite samples may show deviations. Residual diagnostics include: - residual-versus-time plot;
- histogram or density plot;
- ACF of residuals;
- residual variance by time or fitted level;
- outlier and intervention review;
- Ljung–Box test.
A residual that is uncorrelated is not necessarily harmless. Conditional heteroskedasticity, changing business conditions, biased forecasts, or asymmetric costs may remain. Forecast intervals should widen with horizon when uncertainty accumulates. Under a normal-error approximation, an interval can be expressed as ŷt+h|t ± z1−α/2 × SE(et+h|t) where h is the forecast horizon, SE(et+h|t) is the forecast-error standard deviation, α is the interval error probability, and z1−α/2 is the corresponding standard-normal quantile. The units of both the forecast and standard error must match the demand units. Normality is an approximation; bootstrap or simulation intervals may be preferable for skewed or transformed data. Accuracy measures should match the managerial purpose. Common measures include MAE = (1 ÷ n) ∑|yt − ŷt| and RMSE = √[(1 ÷ n) ∑(yt − ŷt)²] MAE is in demand units and treats errors linearly. RMSE is also in demand units but penalises large errors more heavily. MAPE is problematic when actual demand is zero or close to zero. WAPE, scaled errors, pinball loss for quantile forecasts, and service-level measures may be more appropriate in operations. 8. Time-Series Cross-ValidationRandomly shuffling observations is inappropriate because it allows future information to enter the training data. Time-series cross-validation preserves temporal order. In a rolling-origin design, the model is trained through time t, forecasts the next h periods, and is then re-estimated or updated at a later origin. For origins t1, t2, …, tK, a generic mean absolute error is MAEh = (1 ÷ K) ∑k=1K|ytk+h − ŷtk+h|tk| where h is fixed and K is the number of forecast origins. The training window may be expanding, using all data available at each origin, or rolling, using only a fixed recent window. An expanding window is useful when historical relationships remain relevant; a rolling window can adapt more rapidly after structural change. Cross-validation design should reflect the actual forecast process: forecast horizon, data refresh schedule, latency, promotions known in advance, and model-retraining policy. Comparing models on a single holdout period can be misleading if that period is unusually volatile. 9. Illustrative Case: Regional Grocery DemandBackgroundThis illustrative case concerns a regional grocery distributor forecasting monthly demand for chilled fruit juice across 40 stores. The planning horizon is three months, and inventory decisions are made monthly. ProblemHistorical sales increased over four years, with strong summer demand. The seasonal amplitude also grew as distribution expanded. Several low-sales months coincided with stockouts, and a promotional campaign produced an exceptional spike. AnalysisThe analyst first separated store-level stockout periods from ordinary observations and flagged the promotion as an intervention rather than deleting it without explanation. A time plot indicated trend and annual seasonality. Because variability increased with the level, a logarithmic transformation was considered. The ACF showed large correlations at lags 1 and 12, suggesting both short-term dependence and annual seasonality. Seasonal naïve, ETS, ARIMA, and SARIMA candidates were evaluated. After logarithmic transformation, one seasonal difference and one ordinary difference produced a more stable series. Candidate SARIMA models were estimated with annual period m = 12. Residual ACFs were inspected, and the Ljung–Box test did not indicate material remaining serial correlation for the selected model. However, residual variance remained higher during promotion periods. Approach and OutcomeRolling-origin validation used the final 18 months as multiple forecast origins, with horizons of one, two, and three months. The selected SARIMA model improved three-month MAE relative to the seasonal naïve benchmark, but the improvement was smaller during promotions. The business therefore adopted a hybrid process: the statistical forecast supplied the baseline, while known future promotions were represented through intervention variables and reviewed by planners. Forecasts were transformed back to units with bias adjustment based on historical residual variance. Prediction intervals were reported rather than only point forecasts, allowing inventory managers to choose safety stock according to target service levels. Learning Points- Recorded sales required correction for stockouts before modelling demand.
- A benchmark was essential for judging whether SARIMA added value.
- Promotions represented explainable interventions, not ordinary noise.
- Validation had to match the three-month operational horizon.
- Forecast uncertainty was operationally important because over- and under-forecasting had different costs.
10. Managerial, Ethical, and Technological ConsiderationsForecasts influence purchasing, staffing, capacity, supplier commitments, and customer availability. Managers should therefore distinguish statistical accuracy from decision quality. A forecast can be numerically accurate but operationally harmful if it systematically understates demand during high-margin periods or ignores service-level priorities. Governance requires version-controlled data, documented transformations, reproducible training windows, parameter records, and monitoring of forecast bias. Personal data are usually not required for aggregate demand forecasting, but customer-level systems must follow privacy, access-control, retention, and applicable data-protection requirements. Automated model selection and machine-learning systems can search many candidate specifications efficiently. They do not remove the need for data-quality review, causal interpretation, leakage prevention, or human accountability. Artificial intelligence may assist anomaly detection, hierarchical reconciliation, and probabilistic forecasting, but model outputs should be monitored for drift and discriminatory allocation effects. In particular, repeated stockouts can create apparently low demand and cause an algorithm to recommend even lower replenishment, producing a harmful feedback loop. Contemporary practice increasingly combines statistical time-series models with explanatory variables, hierarchical forecasting, intermittent-demand methods, probabilistic forecasts, and forecast reconciliation across product, store, regional, and national levels. ARIMA remains valuable because it is transparent, computationally efficient, and often highly competitive for stable univariate series. It is not a universal solution: causal models, dynamic regression, state-space models, or machine-learning methods may be preferable when external drivers dominate. Challenges and LimitationsARIMA assumes that the future can be usefully related to past values and past shocks under a reasonably stable process. It performs poorly when structural breaks are ignored, when demand is intermittent with many zeros, when multiple complex seasonalities exist, or when external variables drive demand. Differencing can remove long-run information, and transformations complicate interpretation. Parameter uncertainty, model selection uncertainty, and forecast uncertainty all matter. No diagnostic test proves that a model is correct. A model is useful when it is sufficiently accurate, stable, explainable, and aligned with the decision context. Forecasting should therefore be treated as an ongoing process of measurement, validation, intervention, and monitoring rather than a one-time model-fitting exercise. Chapter SummaryTime-series demand contains level, trend, seasonality, cycles, irregular variation, and possible structural breaks. Decomposition clarifies these components, while transformations can stabilise variance. Stationarity concerns constant mean, variance, and lag-dependent covariance; differencing is a principal tool for achieving it, but over-differencing should be avoided. Autocorrelation and partial autocorrelation help identify temporal dependence. ARIMA combines autoregressive terms, differencing, and moving-average terms. SARIMA extends ARIMA with seasonal dependence and seasonal differencing. Model adequacy requires residuals that are approximately uncorrelated and stable, but formal tests must be interpreted with plots and operational knowledge. Rolling-origin time-series cross-validation is essential because random shuffling causes temporal leakage. Seasonal naïve and other simple methods should serve as benchmarks. Finally, forecasting governance must address stockouts, promotions, structural change, uncertainty, documentation, privacy, automation, and the consequences of forecast error. Key TermsStationarity: A condition in which the main probabilistic properties of a series remain stable over time. Trend: Persistent long-term movement in the level of a series. Seasonality: A pattern that repeats at a known calendar or operational frequency. Cycle: Longer-term fluctuation without a fixed, known period. Autocorrelation: Correlation between observations separated by a specified lag. Partial autocorrelation: Correlation at a lag after controlling for intermediate lags. Decomposition: Separation of a series into trend, seasonal, and remainder components. Additive model: A model in which components combine through addition. Multiplicative model: A model in which components combine through multiplication. Differencing: Subtracting current and lagged observations to remove non-stationarity. Backshift operator: The operator B satisfying Byt = yt−1. ARIMA: Autoregressive integrated moving-average model. SARIMA: Seasonal autoregressive integrated moving-average model. Innovation: A new shock or error not predictable from information available previously. Residual: The observed value minus its fitted or forecast value. White noise: A sequence with zero mean, constant variance, and no serial correlation. Ljung–Box test: A joint test for residual autocorrelation across selected lags. Rolling-origin validation: Evaluation that repeatedly trains on the past and forecasts later observations. Structural break: A change in the underlying data-generating process. Forecast interval: A range expressing uncertainty around a point forecast. Review QuestionsShort Answer Questions- What distinguishes trend from seasonality in a demand series?
- Define weak stationarity and state its three principal conditions.
- What is the purpose of differencing in an ARIMA model?
- Why should a seasonal naïve forecast be included as a benchmark?
- What does a residual ACF reveal about model adequacy?
Long Answer Questions- Explain the assumptions, notation, and practical interpretation of an ARIMA(p,d,q) model.
- Compare additive and multiplicative decomposition, including when a logarithmic transformation is appropriate.
- Explain how SARIMA extends ARIMA and interpret the roles of P, D, Q, and m.
- Develop a complete workflow for forecasting monthly retail demand, from data audit through monitoring.
- Discuss why statistical forecast accuracy and operational decision quality may differ.
Analytical / Application Questions- A monthly series has increasing variance, strong annual seasonality, and ACF spikes at lags 12 and 24. Propose a transformation, differencing strategy, candidate model class, and diagnostic plan.
- A SARIMA model has lower AIC than a seasonal naïve benchmark but higher three-month rolling-origin MAE. Which model should be preferred, and what additional evidence would you examine?
- A product appears to have declining demand, but most declining months coincide with stockouts. Explain how this affects model specification, data preparation, forecast governance, and replenishment decisions.
Multiple Choice Questions with AnswersQuestion 1Which condition is required for weak stationarity? A. A mean that increases linearly over time B. A constant finite variance C. Independent observations at every lag D. A seasonal period equal to 12 Correct Answer: B. A constant finite variance Question 2In an additive decomposition, which relationship is used? A. y_t = T_t × S_t × R_t B. y_t = T_t + S_t + R_t C. y_t = T_t ÷ S_t ÷ R_t D. y_t = T_t − S_t × R_t Correct Answer: B. y_t = T_t + S_t + R_t Question 3What does the parameter d represent in ARIMA(p,d,q)? A. The number of seasonal cycles B. The number of moving-average terms C. The number of ordinary differences D. The number of forecast horizons Correct Answer: C. The number of ordinary differences Question 4For monthly data with annual seasonality, what is the usual seasonal period m? A. 4 B. 7 C. 12 D. 52 Correct Answer: C. 12 Question 5Which method best preserves temporal order during model evaluation? A. Randomly shuffling all observations B. Rolling-origin cross-validation C. Training only on the last observation D. Selecting the model with the largest in-sample error Correct Answer: B. Rolling-origin cross-validation Question 6What is the main purpose of residual autocorrelation analysis? A. To determine the product price B. To identify remaining temporal structure not captured by the model C. To guarantee normally distributed demand D. To calculate the seasonal period automatically Correct Answer: B. To identify remaining temporal structure not captured by the model Question 7If variability increases as demand level increases, which transformation is often considered? A. Logarithmic transformation B. Random permutation C. Adding a seasonal lag without inspection D. Replacing all values by their ranks Correct Answer: A. Logarithmic transformation Question 8Which statement about RMSE is correct? A. It is measured in squared demand units B. It ignores large errors C. It is measured in demand units and penalises large errors more heavily than MAE D. It can be calculated only for stationary series Correct Answer: C. It is measured in demand units and penalises large errors more heavily than MAE Question 9A seasonal naïve forecast for monthly data usually uses which observation? A. The immediately preceding month only B. The observation 12 months earlier C. The overall sample mean only D. The first observation in the series Correct Answer: B. The observation 12 months earlier Question 10What is a major risk of ignoring stockouts in demand forecasting? A. The model may interpret constrained sales as low underlying demand B. The model will always become stationary C. Seasonality will necessarily disappear D. Forecast intervals will become exactly zero Correct Answer: A. The model may interpret constrained sales as low underlying demand
|