Regression, Dynamic Regression, and Intervention AnalysisIntroduction and ContextTime-series forecasting often begins with the question: “What will happen next?” A more useful managerial question is frequently: “What will happen next, given what we know about prices, promotions, weather, policy, competitors, and past outcomes?” Regression-based time-series models address this question by combining explanatory variables with temporal structure. A conventional regression model assumes that observations are independent, or that dependence has been adequately handled. Time-series observations commonly violate this assumption. Sales this week may resemble sales last week; electricity demand may depend on yesterday’s temperature; a policy announcement may create a permanent level shift; and holidays may generate recurring but irregular effects. Regression for time series must therefore model both the systematic effects of predictors and the serial dependence remaining in the errors. This chapter develops a framework that progresses from deterministic trend and seasonal regression to dynamic regression, distributed lags, transfer functions, ARIMA errors, interventions, and calendar effects. It also distinguishes three interpretations that are often confused: - Explanatory interpretation: a variable is statistically associated with the outcome after controlling for other variables.
- Causal interpretation: a defensible design and set of assumptions support a claim that changing the variable changes the outcome.
- Predictive interpretation: the model produces accurate forecasts, whether or not its coefficients have causal meaning.
The distinction is central in business analytics. A model may forecast demand accurately because it uses a leading indicator, while providing little evidence that manipulating that indicator would cause demand to change. Learning ObjectivesBy the end of this chapter, the reader should be able to: - Construct regression models for trend, seasonality, and external drivers.
- Explain why autocorrelated errors invalidate ordinary regression diagnostics and standard errors.
- Use lagged predictors, distributed lags, and transfer-function ideas to represent delayed effects.
- Specify and interpret dynamic regression models with ARIMA errors.
- Model interventions, structural breaks, promotions, holidays, and other calendar events.
- Distinguish explanatory, causal, and predictive claims.
- Evaluate models using time-ordered validation, residual diagnostics, and decision-relevant metrics.
1. Regression as a Time-Series ModelLet yt denote the observed outcome at time t, and let x1t,…,xkt denote predictors. A basic regression is yt = β0 + β1x1t + β2x2t + ⋯ + βkxkt + εt Here, β0 is the intercept, βj is the partial effect associated with predictor xjt, and εt is the error at time t. The equation is applicable when the conditional mean is adequately represented by the predictors and the interpretation of coefficients is appropriate for the scale of the outcome. For a classical regression, errors are often assumed to satisfy E(εt)=0, constant variance, and no serial correlation. In time series, the more realistic formulation is yt = β0 + β′xt + nt where nt is a temporally correlated error process. The vector β contains regression coefficients and xt contains all predictors at time t. A dynamic regression model estimates the conditional mean through β′xt while explicitly modelling nt. A regression coefficient is measured in outcome units per unit of the predictor, unless a transformation changes the interpretation. If weekly revenue is measured in thousands of dollars and advertising expenditure in thousands of dollars, a coefficient of 0.8 means an estimated increase of 0.8 thousand dollars in weekly revenue for a one-unit increase in advertising, conditional on the model and its controls. 1.1 Trend RepresentationA linear trend can be represented using time: yt = β0 + β1t + εt The coefficient β1 is the average change in the conditional mean per time period. A polynomial trend adds curvature: yt = β0 + β1t + β2t2 + εt Polynomial trends can behave implausibly outside the estimation range, so they should not be extrapolated mechanically. A piecewise trend or spline is often safer when growth changes at identifiable points. For multiplicative growth, a logarithmic model is useful: ln(yt) = β0 + β1t + εt If β1 is small, the approximate percentage change per period is 100β1%. More exactly, the ratio of fitted values for adjacent periods is eβ1, so the exact percentage change is 100(eβ1-1)%. The log model requires positive outcomes. 1.2 Seasonal IndicatorsFor monthly data with seasonality, one month can be treated as a reference category. Define indicator Djt=1 when observation t belongs to month j, and zero otherwise. With January omitted, yt = β0 + β1t + γ2D2t + ⋯ + γ12D12,t + εt Each γj measures the conditional difference from January, holding trend and other predictors constant. Omitting one category avoids perfect multicollinearity with the intercept. For quarterly data, three indicators are used with one quarter as reference. Seasonal indicators allow each season to have a distinct effect. They are flexible but require enough observations to estimate multiple coefficients. They also assume that the seasonal pattern is stable over the modelling period unless interactions or time-varying terms are added. 1.3 Fourier TermsA smooth seasonal pattern can be represented with sine and cosine terms: yt = β0 + β1t + ∑k=1K[ak sin(2πkt/m) + bk cos(2πkt/m)] + εt Here, m is the seasonal period, such as 12 for monthly annual seasonality, K is the number of harmonics, and ak,bk are coefficients. The largest useful value is generally no more than ⌊m/2⌋, but small K is usually preferred for smooth seasonality. Fourier terms are advantageous when the seasonal cycle is long or when a parsimonious smooth pattern is desired. Indicator variables are more appropriate when each season has a distinct, non-smooth effect. Fourier terms can also represent multiple seasonalities, such as daily and weekly patterns, by adding terms with different periods. 2. External Drivers and InterpretationExternal drivers may include price, advertising, temperature, exchange rates, search intensity, economic activity, capacity, and competitor actions. A model such as yt = β0 + β1pricet + β2promotiont + β3temperaturet + nt is useful only when timing, availability, measurement, and forecastability of the predictors are considered. A predictor that is unavailable at forecast origin cannot be used without first forecasting it or using a scenario value. A contemporaneous coefficient may not represent the full effect. Advertising this week may influence sales over several weeks, while a price change may have an immediate effect and a delayed retention effect. Lagged predictors address this issue: yt = β0 + β1xt + β2xt-1 + β3xt-2 + nt The impact at lag zero is β1, at lag one is β2, and at lag two is β3. The cumulative effect of a one-unit increase applied in one period, assuming no other changes, is the sum of the relevant lag coefficients: Total effect = β1 + β2 + ⋯ + βL where L is the maximum included lag. This interpretation assumes a linear additive model and an intervention that changes the predictor in the specified way. 2.1 Distributed-Lag ModelsA distributed-lag model includes several lags of a predictor. A long unrestricted lag structure can be unstable because adjacent lagged predictors are highly correlated. Restrictions can improve estimation. A geometrically declining effect can be represented by a Koyck-type structure, although the implied assumptions must be checked. Polynomial distributed lags impose a smooth polynomial pattern across lag coefficients. Lag selection should reflect domain knowledge, operational delay, and validation performance. Including many lags merely because they improve in-sample fit increases variance and may produce implausible effects. 2.2 Transfer FunctionsTransfer-function models generalize distributed lags by allowing an input to affect an output through a dynamic filter. In operator notation, where B is the backshift operator satisfying Bxt=xt-1, a simple transfer function is yt = c + [ω(B)/δ(B)]xt + nt The numerator polynomial ω(B) describes finite or shaped lag effects, while the denominator δ(B) describes persistence or decay. The error process nt may follow an ARIMA model. Transfer functions require careful identification, adequate data, and stable dynamics; they should not be treated as automatically causal mechanisms. 3. Why ARIMA Errors MatterSuppose the conditional mean is correctly specified but the errors are positively autocorrelated. Ordinary least squares coefficient estimates may remain unbiased under strong exogeneity conditions, but conventional standard errors are generally unreliable, and forecasts fail to use predictable error structure. Residual autocorrelation also signals that the mean model may omit relevant dynamics. A dynamic regression with ARIMA errors is written as yt = β′xt + nt where nt follows an ARIMA(p,d,q) process, possibly with seasonal components. For a stationary AR(1) error, the model is nt = φnt-1 + et where et is white noise with mean zero and variance σe2, and stationarity requires |φ|<1. If φ=0.7, a shock persists: after one period its expected remaining component is 70% of the original shock, after two periods 49%, and so on, under the model. An ARIMA error model can be expressed using differencing and moving-average terms. With the backshift operator B, a general nonseasonal form is φ(B)(1−B)d nt = θ(B)et where φ(B) is the autoregressive polynomial, d is the differencing order, θ(B) is the moving-average polynomial, and et is white noise. Differencing should be used only when needed to achieve an appropriate stochastic trend representation; unnecessary differencing can distort dynamics. 3.1 Model Identification and DiagnosticsA practical workflow is: - Define the forecast target, time frequency, forecast horizon, and forecast origin.
- Inspect the outcome and predictors for scale, missing values, outliers, breaks, and changing variance.
- Decide whether trend and seasonality should be represented by indicators, Fourier terms, transformations, or differencing.
- Create only predictors available at the forecast origin.
- Specify plausible lag structures using operational knowledge.
- Fit a regression with candidate ARIMA errors.
- Examine residual autocorrelation, residual variance, influential observations, and parameter stability.
- Compare candidate models using rolling-origin validation, not random train-test splits.
- Produce forecasts with prediction intervals and document assumptions.
Residuals should approximate white noise after all systematic structure is modelled. The sample autocorrelation at lag k is commonly inspected through an ACF plot, while a portmanteau test such as Ljung–Box can assess whether a group of autocorrelations is collectively inconsistent with white noise. Such tests are not proof of model correctness; with large samples, trivial deviations may become significant, and with small samples, important dependence may be missed. Use time-series cross-validation. For an expanding-window design, fit on observations 1 through T1, forecast the next horizon, expand the training set, and repeat. For predictions ŷt, common measures include MAE = (1/n)∑|yt − ŷt| and RMSE = √[(1/n)∑(yt − ŷt)2] MAE has the same units as the outcome. RMSE also has those units but penalizes large errors more heavily. Percentage measures can be misleading when actual values are near zero. Evaluation should therefore reflect the business loss function, such as stockout cost, staffing cost, or asymmetric service penalties. 4. Interventions, Structural Breaks, and Calendar EventsAn intervention is an event whose timing is known and whose effect may alter the series. Examples include a product launch, pricing policy, regulation, system migration, strike, natural disaster, or marketing campaign. Intervention analysis separates the event effect from ordinary trend, seasonality, and autocorrelation. 4.1 Pulse, Step, and Ramp VariablesA pulse variable represents a temporary one-period effect: Pt = {1 if t = T, 0 otherwise} A step variable represents a permanent level change beginning at time T: St = {0 if t < T, 1 if t ≥ T} A ramp represents a gradual post-event change. One simple form is Rt = max(0, t − T + 1) A model may include both a step and a ramp: yt = β0 + β1t + δSt + ρRt + nt Here, δ is the immediate level shift and ρ is the additional change per period after the intervention. The coding must match the substantive question. A “temporary promotion” may require a pulse or a finite-duration indicator rather than a permanent step. 4.2 Interrupted Time Series and Causal CautionAn interrupted time-series design compares the observed post-event trajectory with the pre-event trajectory extrapolated forward. It can provide stronger evidence than a simple before–after comparison, especially when many pre-intervention observations are available. However, causal interpretation requires assumptions: no simultaneous unmodelled shock, stable measurement, appropriate functional form, and credible control of seasonality and serial dependence. A control series unaffected by the intervention can strengthen the design through a comparative interrupted time series or difference-in-differences framework. A statistically significant intervention coefficient does not automatically establish causality. The event may coincide with a competitor’s action, macroeconomic change, supply disruption, or a change in data collection. 4.3 Calendar EffectsCalendar effects include day-of-week, month, quarter, public holiday, pay-cycle, school-term, trading-day, and leap-year effects. Holiday effects can be represented by an indicator, but the relevant window may include days before and after the holiday. Moving holidays require calendar-based rather than fixed-date coding. For business forecasting, calendar variables should be constructed prospectively so that future values are known without leakage. 5. Worked Example: Weekly Retail DemandConsider weekly unit demand for a retailer over 156 weeks. Management wants forecasts for the next four weeks and an estimate of the effect of a digital promotion. Demand appears seasonal, with a twelve-week merchandise cycle, and temperature affects demand with a delay. An illustrative model is yt = β0 + β1t + a1sin(2πt/12) + b1cos(2πt/12) + γPt + η0Tempt + η1Tempt-1 + nt where: - yt is weekly unit demand;
- t is the week index;
- the sine and cosine terms represent smooth twelve-week seasonality;
- Pt equals 1 during the promotion and 0 otherwise;
- Tempt and Tempt-1 are current and previous-week temperature;
- γ is the promotion coefficient;
- nt follows an AR(1) error process.
Suppose estimation produces γ=420, η0=18, and η1=10. Holding other predictors constant, the estimated promotion-associated increase is 420 units in the promotion week. A one-degree increase in temperature, if sustained for two consecutive weeks, is associated with 18 + 10 = 28 additional units across the two relevant contributions, subject to the model’s additive and linear assumptions. Suppose the estimated AR(1) coefficient is φ=0.65. A positive unexplained shock of 100 units is expected to leave 65 units of its modelled effect one week later and 42.25 units two weeks later, since 100×0.652=42.25. This is persistence in the error process, not a claim that the promotion itself decays at 65% per week. The analyst evaluates the model with rolling four-week forecasts. A model using seasonal indicators instead of Fourier terms has slightly lower in-sample error but higher rolling-origin MAE. The Fourier model is preferred for forecasting, provided residuals are adequately uncorrelated and the seasonal form remains plausible. The promotion coefficient should be reported as an adjusted association unless the promotion was assigned through a credible experimental or quasi-experimental design. If promotions were targeted precisely at products expected to sell more, γ may be confounded by selection. 6. Applied Case: Illustrative Hospital Appointment DemandBackgroundA regional hospital schedules outpatient clinics weekly. Missed appointments create idle capacity, whereas understaffing produces long waits. The hospital introduces automated reminders at the beginning of week 40 and wants to know whether demand and attendance changed. ProblemA simple comparison of average attendance before and after week 40 is inadequate because attendance has a trend, school-holiday seasonality, influenza waves, and serial dependence. Reminder implementation also coincided with a change in online booking. AnalysisThe analytics team models weekly attended appointments using a trend, month-of-year indicators, influenza incidence, public-holiday indicators, and an intervention step. A separate pulse variable represents the implementation week, and a post-intervention ramp tests whether the effect grows as patients become familiar with reminders. The residuals are modelled with ARIMA errors. A comparable clinic that did not receive reminders provides a control series. The team checks whether the intervention date was recorded accurately, whether booking definitions changed, and whether future predictor values are known. Rolling-origin forecasts are evaluated using MAE and a capacity-weighted loss function. Residual ACF plots are inspected, and sensitivity analyses remove weeks affected by an exceptional outbreak. Approach and OutcomeSuppose the step coefficient is positive after adjustment, but the comparative model shows a similar increase in the control clinic. The evidence then supports an organization-wide change rather than a reminder-specific causal effect. Forecast performance improves when influenza incidence and holiday indicators are included, but the reminder coefficient is unstable across specifications. The appropriate management conclusion is not “reminders caused the increase.” It is: “The post-implementation period had higher attendance, but the observed change cannot be separately attributed to reminders because a concurrent system change affected both clinics.” The model may still be useful for staffing forecasts. Learning Points- Forecasting value and causal evidence are different outputs.
- A control series can reveal common shocks.
- Intervention coefficients are sensitive to timing, controls, and functional form.
- Operationally available predictors are essential for deployable forecasts.
- Governance requires documenting data definitions and model changes.
7. Common Failure Modes and Best PracticesLeakage and Timing ErrorsUsing revised economic data, future promotions, final monthly totals, or post-event variables in historical training can create leakage. Every predictor must be timestamped according to when it became available, not merely when it describes the world. MulticollinearityTrend, seasonal indicators, Fourier terms, and slowly changing external variables can overlap. Coefficients may become unstable even when forecasts remain adequate. Examine design-matrix condition, coefficient uncertainty, and sensitivity to alternative specifications. Overfitting Lag StructuresMany lagged predictors consume degrees of freedom and create unstable signs. Begin with a small, substantively justified lag structure, then compare alternatives through rolling validation and residual diagnostics. Structural ChangeA relationship estimated before a market disruption may not hold afterward. Use time-varying coefficients, interactions, re-estimation windows, state-space approaches, or regime-specific models when evidence supports changing parameters. These methods increase complexity and require stronger validation. Transformation and Back-TransformationWhen modelling ln(yt), exponentiating the fitted mean does not always recover the mean of yt because of retransformation bias. If log-scale errors are approximately normal with variance σ2, a simple correction for the conditional mean is eμt+σ2/2, where μt is the predicted log mean. The correction must be adapted when variance is nonconstant or errors are nonnormal. Ethical and Governance ConsiderationsExternal-driver models can encode unfair allocation decisions. A demand forecast used to allocate healthcare access, credit resources, or public services should be audited for disparate error and inappropriate proxy variables. Intervention analysis involving individuals must respect privacy, data minimization, access controls, and applicable regulation. Forecast intervals should be communicated honestly; false precision can produce unsafe staffing or inventory decisions. Model cards or equivalent documentation should record data provenance, forecast horizon, known limitations, intervention dates, and retraining policy. 8. Contemporary PracticeModern forecasting systems often combine regression features with ARIMA, exponential smoothing, state-space, gradient-boosting, or neural models. Machine-learning models can discover nonlinear interactions, but they do not automatically solve temporal leakage, causal identification, or extrapolation beyond observed interventions. A strong professional workflow often uses interpretable regression or dynamic regression as a benchmark, then tests more complex models against it using identical time-based validation. Probabilistic forecasting is increasingly important. Rather than reporting only ŷt+h, analysts report prediction intervals or quantiles. Intervals must incorporate uncertainty in regression coefficients, future predictors, and dynamic errors. Scenario forecasting is especially appropriate when future prices, promotions, or policy variables are controllable rather than known. Best practice is therefore not to seek the most complicated model. It is to construct a model whose timing, assumptions, diagnostics, uncertainty, and operational use are defensible. Chapter SummaryRegression-based time-series models combine systematic predictors with temporal dependence. Trend can be represented by time or transformations; seasonality by indicators or Fourier terms; and external drivers by contemporaneous and lagged variables. Distributed lags capture delayed effects, while transfer functions represent richer dynamic responses. ARIMA errors model serial dependence left after explaining the conditional mean. Intervention analysis uses pulse, step, and ramp variables to represent temporary shocks, permanent level changes, and gradual post-event trends. Calendar effects must be coded prospectively and in a way consistent with operational timing. Residual diagnostics and rolling-origin validation are essential because random train-test splits are inappropriate for most forecasting tasks. Most importantly, a coefficient may be explanatory without being causal, and a model may be predictive without offering a credible intervention effect. Causal interpretation requires design, assumptions, controls, and sensitivity analysis. Professional forecasting also requires attention to leakage, structural change, uncertainty, fairness, privacy, and governance. Key TermsDynamic regression: Regression with time-dependent errors or lagged dynamics. Exogenous predictor: A predictor treated as determined outside the modelled outcome process. Fourier term: A sine or cosine component used to represent smooth periodic structure. Intervention: A known event that may change a time series. Lag: A previous value of a variable, such as xt-1. Distributed lag: A model containing several lags of a predictor. Transfer function: A dynamic filter describing how an input influences an output over time. Pulse variable: An indicator for a temporary one-period event. Step variable: An indicator for a level change that persists after an event. Ramp variable: A variable representing a gradual post-event change. ARIMA error: An autoregressive integrated moving-average process used for residual dynamics. Backshift operator: Operator B that shifts a series one period backward. Seasonal indicator: A categorical variable representing a recurring period. Rolling-origin validation: Time-ordered evaluation using repeated forecast origins. Forecast leakage: Use of information unavailable at the time a forecast would have been made. Interrupted time series: Analysis of a time series before and after a known intervention. Causal interpretation: A claim that changing one factor changes the outcome under stated assumptions. Prediction interval: An interval expressing uncertainty about a future observation. Structural break: A change in the data-generating process or model parameters. Review QuestionsShort Answer Questions- Why can ordinary regression standard errors be unreliable for time-series data?
- What is the difference between a seasonal indicator and a Fourier representation?
- Define a distributed-lag model and explain why it may be useful.
- What do pulse, step, and ramp variables represent?
- Why must future predictor availability be considered before deploying a forecasting model?
Long Answer Questions- Explain the structure and interpretation of a dynamic regression model with ARIMA errors. Include assumptions and diagnostic requirements.
- Compare seasonal indicators and Fourier terms for modelling recurring patterns. Discuss flexibility, parsimony, and extrapolation.
- Explain how an interrupted time-series analysis can be used to study a policy intervention, including threats to causal interpretation.
- Discuss the advantages and risks of including lagged external drivers in a business forecasting model.
- Develop a complete workflow for building and validating a regression-based time-series forecast for a retailer.
Analytical / Application Questions- A model estimates immediate, one-week, and two-week advertising effects of 120, 80, and 40 sales units per advertising unit. Calculate the cumulative effect and explain the assumptions behind the calculation.
- A policy begins in week 30. Demand rises immediately and then increases by an additional 15 units per week. Specify suitable intervention variables and interpret their coefficients.
- A promotion coefficient is positive in a regression, but the same increase occurs in a control store that did not receive the promotion. Evaluate the evidence and recommend a better analytical design.
Multiple Choice Questions with AnswersQuestion 1Which model component represents a permanent level change beginning at time T? A. Pulse variable B. Step variable C. Fourier sine term D. Lagged error Correct Answer: B. Step variable Question 2In a distributed-lag model, the cumulative effect of a one-unit predictor change is generally calculated as: A. The largest lag coefficient only B. The intercept divided by the number of lags C. The sum of the relevant lag coefficients D. The residual variance Correct Answer: C. The sum of the relevant lag coefficients Question 3For a stationary AR(1) error process, which condition is required for stationarity? A. φ = 1 B. |φ| < 1 C. φ > 2 D. φ = 0 only Correct Answer: B. |φ| < 1 Question 4What is the main purpose of Fourier terms in time-series regression? A. To represent smooth periodic patterns B. To remove all missing values C. To guarantee causal interpretation D. To replace forecast validation Correct Answer: A. To represent smooth periodic patterns Question 5Why is random train-test splitting usually inappropriate for time-series forecasting? A. It prevents calculation of MAE B. It can use future information when evaluating past forecasts C. It always increases model bias D. It eliminates seasonality Correct Answer: B. It can use future information when evaluating past forecasts Question 6If immediate, one-period, and two-period lag coefficients are 50, 30, and 20, what is their cumulative effect? A. 20 B. 50 C. 80 D. 100 Correct Answer: D. 100 Question 7A pulse intervention variable is equal to one: A. For every period after an event B. Only during the specified event period C. Before and after the event equally D. Whenever the outcome is zero Correct Answer: B. Only during the specified event period Question 8A positive regression coefficient should automatically be interpreted as causal when: A. The p-value is below 0.05 B. The sample size is large C. A credible causal design and assumptions support that interpretation D. The model includes a trend Correct Answer: C. A credible causal design and assumptions support that interpretation Question 9Which metric has the same units as the forecasted outcome and penalizes large errors more strongly? A. RMSE B. MAPE only C. Correlation D. R-squared Correct Answer: A. RMSE Question 10What is forecast leakage? A. A failure of residuals to be normally distributed B. Using information unavailable at the forecast origin C. A seasonal pattern in the outcome D. A permanent intervention effect Correct Answer: B. Using information unavailable at the forecast origin
|