The Lawfare Academy

Lawfare Group → Knowledge Institute → Lawfare Academy

← Back to program

← Regression and Business Forecasting

Unit 6

Time series and forecast uncertainty

Learning objectives

  • Explain time series and forecast uncertainty in your own words.
  • Apply the principle to the worked business case.
  • Evaluate the answer and identify an assumption that could change it.

Time series and forecast uncertainty

Time series can include trend, seasonality, and autocorrelated errors. Use chronological validation to avoid future information leaking into training. Report intervals and conditional assumptions rather than one precise number.

Worked example

A forecast uses next month's actual supplier cost while pretending to predict from today.

Current on-site learning

Required teaching and complete optional models are supplied on LawfareGroup.com. Publisher and primary links are optional provenance or further reading. Florida is the contemporary state-law default; federal rules and explicitly comparative accounting frameworks are distinguished. Independent subject review and observed human learner testing remain pending.

Work through the reasoning

Define the population, sampling or assignment process, variables, estimator, and intended inference. For this unit, connect the explanation of time series and forecast uncertainty to the worked example before answering the practice question.

Check the limits

Check dependence, selection, uncertainty, and whether the evidence supports description, prediction, or causation. If the source model and the practical example use different assumptions, state the difference rather than applying the formula or rule mechanically.

Apply it independently

What is the modeling failure? Write an answer before opening the model response. Show the calculation or explain the causal or logical steps. Change one material assumption and say whether your conclusion changes. This practice is optional; you can read every part of the course without submitting work.

Advanced investigation: Rolling-origin validation and a forecast that cannot borrow the future

A time-series evaluation must reproduce the information available when a forecast is made. An ordinary random train/test split can put later outcomes into training for an earlier prediction. Even chronological rows are not enough if a feature uses a revised value, a centered moving average or a label unavailable at the forecast origin. Record the observation time, availability time, prediction time and target horizon.

Rolling-origin evaluation refits or updates using only the allowed past, predicts the next specified horizon and records the error before moving the origin. Expanding windows retain all previous observations; sliding windows keep a bounded recent history. The choice reflects a tradeoff between more data and adaptation to change. Use the same origins and horizons when comparing methods so a difficult period does not disappear from one candidate's denominator.

A naive last-observation forecast is a serious baseline for some short-horizon tasks. A seasonal naive baseline can be appropriate when calendar seasonality is present. Compare errors using a loss aligned with the decision. Mean absolute error measures average absolute deviation. Root mean squared error penalizes large errors more strongly. Percentage errors become undefined or unstable near zero and can distort comparisons across scales. A cost function with different over- and under-forecast penalties may be more directly relevant to staffing or inventory.

Forecast uncertainty includes future shocks as well as coefficient uncertainty. Errors over multiple horizons may be correlated, and overlapping targets share outcomes. Treating every horizon-origin pair as an independent replication can overstate precision. Prediction intervals should be evaluated for coverage and width on a relevant holdout, with separate checks for unusual periods. A nominal 95% label does not demonstrate actual coverage after a distribution change.

Model selection belongs inside the historical information boundary. If the analyst chooses the best window after inspecting all test errors, that period has become development data. Freeze the choice and retain a later evaluation block. Keep the original failed forecasts; replacing them with a refitted hindsight estimate erases the evidence the test was intended to collect.

Worked investigation

For the fictional sequence 10,12,11,14,13,15, compare one-step forecasts at times 4,5,6. A last-observation method predicts 11,14,13, giving actual-minus-forecast errors 3,−1,2 and MAE=2. A trailing-three mean predicts 11,37/3,38/3, giving errors 3,2/3,7/3 and MAE=2. Both have MAE 2, but the sums of squared errors are 14 and 134/9≈14.8889 respectively. The methods tie under absolute loss and differ under squared loss. A centered three-point mean would use the target or later data and is not a valid alternative at those forecast origins.

Independent transfer

If under-forecasting costs 3 units per unit and over-forecasting costs 1, calculate each method's total loss over the three origins. Explain why three errors are insufficient to establish broad forecasting superiority.

Transfer reasoning

The last-observation losses are 9,1,6, totaling 16. The trailing-mean errors are all positive, so losses are 9,2,7, totaling 18. The preferred method depends on the stipulated cost. Three selected origins provide little evidence about seasonality, change or rare large errors; retain a wider predeclared evaluation and examine dependency.

Original Academy expansion: forecasting across time

A forecast is defined by an origin, a horizon, an information set, and a target. Predicting next week's completed jobs on Friday is different from predicting next quarter's receipts at the start of the quarter. Demand, completed work, invoiced revenue, and cash collected are distinct series. Capacity restrictions can make completed jobs understate demand, while payment delays separate revenue from cash. Specify frequency, units, calendar treatment, and revision policies before comparing methods.

Start with simple benchmarks. A naive forecast repeats the latest observed value. A seasonal naive forecast repeats the value from the corresponding previous season. A drift forecast extends the average change from the first to the last observed value. These methods are useful because they establish what more elaborate models must improve upon. A model with many variables is not valuable merely because it has a sophisticated name. Require an improvement at the horizons and losses relevant to the decision.

Worked investigation: a rolling forecast comparison

Take the fictional monthly demand sequence 100, 110, 105, 120, 130, 125. At the end of month 3, a naive forecast for month 4 is 105; its error is 120 - 105 = 15. A three-month moving-average forecast is (100 + 110 + 105)/3 = 105, with the same error. Move the origin to the end of month 4. The naive forecast for month 5 is 120, with error 10. The moving average is (110 + 105 + 120)/3, approximately 111.667, with error approximately 18.333. At the end of month 5, the naive forecast for month 6 is 130, with error -5; the moving average is approximately 118.333, with error approximately 6.667.

Across these three origins, the naive method has MAE 10 and RMSE approximately 10.801. The moving average has MAE approximately 13.333 and RMSE approximately 14.207. Smoothing did not improve this short example. A moving average can lag a rising level because it includes older lower observations. Six constructed values are insufficient to select a production method, but they make the timing and scoring procedure inspectable. Never calculate a centered moving average using future observations and then present it as a forecast available at an earlier origin.

Simple exponential smoothing updates a level estimate by Lt = alpha Yt + (1 - alpha)Lt-1, where alpha lies between 0 and 1. With alpha = 0.5 and an initial level of 100, observing 110 updates the level to 105; observing 105 leaves it at 105; observing 120 updates it to 112.5. A larger alpha responds more quickly but also follows noise more readily. Trend and seasonal methods extend the representation. Their components must be estimated from past data, and apparent seasonal patterns require enough repeated cycles to distinguish them from unusual events.

A time-series regression might include time, seasonal indicators, promotions, or economic predictors. Predictors needed at a future horizon must themselves be known, forecast, or treated as scenarios. Fitting sales on realized next-month weather and then using actual future weather in the test period evaluates a different information set from a real operating forecast. Forecast uncertainty should account for uncertain inputs where material. A conditional interval that assumes a known input does not automatically include uncertainty in that input's forecast.

Rolling-origin evaluation trains only on information available at each origin, produces the required horizon forecast, waits for the actual outcome, and records the error. Expanding windows retain the entire history; sliding windows retain a recent segment. The choice balances estimation stability against adaptation to change. Compare models on the same origins and horizons. Multi-step errors overlap and can be dependent, so a collection of errors is not automatically an independent sample.

Prediction intervals describe a distribution for future outcomes under a model and its assumptions. They are not promises. Evaluate empirical coverage and width on later observations, including the horizons actually used. A 95% interval that covers almost everything because it is unhelpfully wide may be poorly suited to planning. A narrow interval with low coverage understates risk. Structural breaks, new competitors, and policy changes may invalidate a model calibrated to an earlier regime. Maintain an override record identifying the new evidence and later assess whether overrides improved performance.

Progressive practice

  1. Foundation: reproduce every rolling-origin forecast and error in the six-month example.
  2. Application: calculate the next exponential-smoothing level after observing 130, using alpha = 0.5 and prior level 112.5.
  3. Transfer: a monthly cash forecast uses sales as its target. Identify the additional timing relationships needed to forecast receipts.
  4. Synthesis: write a deployment specification containing target, origin, horizon, available predictors, baseline, split design, error measures, interval checks, and a monitoring trigger.

Worked reasoning for the practice

The next smoothed level is 0.5(130) + 0.5(112.5) = 121.25. Forecasting receipts requires invoice timing, payment terms, partial payments, collection delays, refunds, and opening receivables as appropriate. A defensible specification could target next month's collected dollars at each month-end, using only then-available invoices and payment history, compared with a seasonal naive baseline on chronological origins. Score absolute dollar error, shortfall loss, and interval coverage. Review after sustained bias or a documented process change rather than promising that one favorable test period proves permanent accuracy.

Reading alignment for this expansion

The earlier introductory links remain background reading. Use the complete current on-site studios; publisher links are optional provenance. The original Academy worked records above are not quotations from those sources.

Open the runnable laboratory

Extended text lesson

Continue with Separate process uncertainty, estimated parameters and coherent totals for the full worked case, source readings and optional progressive practice.

Extended text lesson

Continue with Regression and forecasting: audit the model before recommending the action for the full worked case, source readings and optional progressive practice.

Complete current conceptual preparation

Build a forecast, preserve its information set and assess its uncertainty

A time index is not an availability timestamp

Define target, units, issue time, cutoff, horizon and permitted revisions. Completed jobs are not unconstrained demand; invoices are not receipts. Calendar-month sums and average daily rates answer different questions when working days differ. A revised supplier-price series can look historical while being unavailable at the old origin. Preserve the first release or appropriate vintage before calling a backtest operational. Missing historical vintages are an evidence limitation, not permission to use hindsight values.

Time plots reveal level shifts, trend, seasonal repetition and changing variability. Seasonality is tied to a known calendar period; a business cycle need not repeat on a fixed schedule. An autocorrelation at lagk compares centered pairs separated byk using a stated convention. For one common descriptive convention r_k=sum fromt=k+1 throughT of[(y_t-ybar)(y_(t-k)-ybar)] divided bysum fromt 1 throughT of(y_t-ybar)². Short-series estimates are unstable and a trend can create apparent autocorrelation. A diagnostic is a clue to a model, not an automatic order-selection rule.

Benchmarks must be executable at the origin

With data throughT, a historical-mean forecast is ybar_T; naive isy_T; seasonal naive repeats the latest observed corresponding season; drift is y_T+h*(y_T-y_1)/(T-1) forT>1. These assumptions differ: mean assumes a stable level, naive persists the last level, seasonal naive persists the seasonal pattern and drift extends the average endpoint change. A trailing moving average smooths noise but can lag trend. Every method uses only allowed past data. These are serious comparison baselines, not proof that one should always win.

Use a separate original quarterly fixture(80,100,120,100,88,110,132,110), observed through quarter 8. Mean 105,naive 110 andone-step drift 110+(110-80)/7=114.285714 give quarter 9 forecasts 105,110,114.285714. Seasonal naive uses quarter 5 and gives 88. Forquarter 10 ituses quarter 6 and gives 110. Choosing a full-series mean after observing future quarter 9 would invalidate the earlier mean forecast. Two years are too short to establish a stable seasonal law, but they make each admissible benchmark reproducible.

An additive seasonal decomposition y_t=T_t+S_t+R_t treats seasonal differences as roughly stable amounts. A multiplicative form y_t=T_t*S_t*R_t can describe proportional amplitude for positive data. For a deliberately specified independent model, seasonal factors(.8,1,1.2,1)average 1 and annual base level 100 predict(80,100,120,100). If the next base level is 110, predictions(88,110,132,110)match the second year. This is a stipulated teaching construction, not an estimated discovery from eightvalues. It explains why a proportional seasonal effect grows with level. A log form can turn multiplicative components into additive terms, with retransformation distinctions fromunit 4 still required.

Trend and seasonal regression is linear in coefficients

An additive quarterly model can be written y_t=a+b*t+c 2*Q 2+c 3*Q 3+c 4*Q 4+epsilon_t, withquarter 1 reference. To see its estimability use the separate exact fixture y_t=100+2 t+10 Q 2+20 Q 3-5 Q 4 for t 1 through 8: outcomes(102,114,126,103,110,122,134,111). The design has five coefficients andeightrows, leavingthree residualdf; its exact synthetic SSE 0 must not be advertised as precise real forecasting. Quarter 9 prediction 118 andquarter 10 prediction 130 extend the stipulated trend and category effects. If the future does not maintain that structure, the formulas fail despite perfect historical fit.

For a real regression fit, forecast exogenous predictors only when known at issue time, otherwise supply explicit scenarios or a joint forecast model. An actual future promotion scheduled and fixed today differs from realized future weather learned later. Conditional intervals that fix a predictor do not include its forecast uncertainty. If a coefficient maps an uncertain future inputXtoY=a+bX+epsilon with independent input error and innovation, Var(Yforecasterror)=b²Var(Xerror)+Var(epsilon), plus any coefficient uncertainty and cross-covariances. Withb 2,inputvariance 9 andinnovation variance 4,the total is 40,not 4. Independence is an assumption; a covariance between input error and innovation adds 2 bCov.

Updating a level and trend

Simple exponential smoothing uses levelL_t=alpha*y_t+(1-alpha)*L_(t-1),0<=alpha<=1; absent additional components its future point forecast staysL_T. Alpha 1 isnaive,alpha 0 neverupdates the initiallevel. On a separate sequence 100,110,105,120 with initial L 1=100 and alpha.5,levels 105,105,112.5 follow. A largeralpha reacts more rapidly but tracks noise. Initialization and parameter selection are part of fitting and must stay inside each evaluation origin.

Holt's additive trend method maintains L_t=alpha*y_t+(1-alpha)*(L_(t-1)+B_(t-1)), B_t=beta*(L_t-L_(t-1))+(1-beta)*B_(t-1), and pointforecasth=L_T+hB_T. WithstipulatedL 1=100,B 1=5,alpha=.5,beta=.25 andy 2=110,L 2=107.5 and B 2=5.625;the two-step forecast from origin 2 is 118.75. A damped trend instead accumulatesphi+...+phi^h timesB_T for 0<phi<1, limiting indefinite linear extrapolation. Seasonalsmoothing adds a seasonal state with an explicit period and enough cycles; its initialization and additive/multiplicative assumptions cannot be inferred from a package's default. This course's numeric scope demonstrates simple and additive-trend updating, seasonal benchmarks/regression and the preserved autoregressive/reconciliation examples; it does not claim every ARIMA or state-space estimator is fully taught.

Process uncertainty and parameter uncertainty remain distinct

Retain the full preserved AR 1 case y_t=100+.8(y_(t-1)-100)+epsilon_t with known normal innovation SD 3 andlast value 120. Means 116,112.8,110.24 andvariances 9,14.76,18.4464 followbyiteration. Long-horizoninnovation variance tends 25 whenabs(phi)<1. Ifphi 1,the model is a random walk with mean 120 andvariance 9 h. Estimating phi and the mean adds uncertainty not covered by plugging estimates into the known-parameter formula. The companion's covariance 37 for component variances 9 and 16 withcovariance 6 mustremain,aswellasitsknown-total 100 reconciliation 41.8919/58.1081. An uncertain executive total cannot be treated as exact without changing the problem.

For an h-step forecast, error includes innovations accumulated over h plus parameter and input uncertainty as applicable. Independent normal innovations justify the particular normal interval in that specified process; actual holdout coverage remains an empirical question. Report width as well as coverage and stratify by relevant horizon. Two components'95%endpoints cannot simply be added to obtain a total 95%interval. Overlapping horizons share outcomes, so a large count of origin-horizon pairs is not a large independent sample.

Reproduce an Excel regression without requiring Excel

For the exact 8-rowtrend/categoryfixture, puttime 1 through 8 inA 2:A 9,outcomeinB 2:B 9,andD 2:D 9=quarter 2 indicator,E=quarter 3,F=quarter 4. Build a contiguous predictor blockH:Kcontainingtime,Q 2,Q 3,Q 4 inthatorder. =LINEST(B 2:B 9,H 2:K 9,TRUE,TRUE) returns the slope coefficients in reverse column order followed by theintercept: firstrow -5,20,10,2,100. Confirm with manually reconstructed predictions; a copied equation with the wrong column order can look plausible while changing every forecast. A newrowfor t 9 needs(9,0,0,0);for t 10 needs(10,1,0,0). Do not enter all four quarter indicators alongside an intercept.

For optional Analysis ToolPak Regression, select Y and the contiguous X block, consistently mark labels if included and retain anintercept. Menu availability varies by device. Save the original paired rows, predictor construction, outputlabels and forecastcutoff. The exact fixture can havezero residual errors and degenerate inferential outputs; do not converttheseinto a real precision claim. Hand calculations and all required explanations here are complete. Excel/R device execution has not been verified, and no installation or outside visit is required.

Optional practice

Guided model: an honest seasonal benchmark

For the first quarterly fixture, quarter 9 seasonal naive is 88 and quarter 10 is 110. One-step drift is 800/7, or 114.285714, from latest value 110 and endpoint growth 30 over seven intervals. Changed fact: quarter 8 was released after the issue cutoff. Neither 110 as latest value nor its endpoint drift is then admissible. Rebuild all benchmarks using the actual available history and identify which seasonal values remain known.

Independent model: input uncertainty

With slope 2, input-error variance 9 and independent innovation variance 4, predictive error variance is 4*9+4=40. Changed fact: covariance between input error and innovation is 1. Add 2*2*1=4 to get 44. Coefficient estimation introduces additional uncertainty. An interval conditional on an input treated as known does not include these terms automatically.

Transfer model: smoothing is an issued procedure

Holt's stipulated origin-2 state L=107.5 and B=5.625 predicts horizon 2 as 118.75. Changed fact: alpha and beta were selected after looking at the final test outcomes. Those outcomes have become development data. Recreate selection within earlier origins, freeze the procedure and obtain an untouched evaluation. A good hindsight fit is not an issued forecast.

Unit rubric: 20 points

Award four points each for availability/target/horizon; reproducible mean, naive, seasonal and drift benchmarks; trend/seasonal representation and state updating; process/input/parameter/dependence uncertainty; and rolling selection with honest software limits. Complete model: quarter9 benchmarks are105,110,800/7 and88; the separate additive trend regression predicts118; Holt's two-step forecast is118.75; input variance is40 or44 under changed covariance. Retain the preserved AR1 and reconciliation assumptions. Keep independent cases distinct and do not promise operational coverage from synthetic examples.

Optional source summary: Forecasting: Principles and Practice, toolbox was read for benchmark definitions, forecast accuracy, transformations and time-series cross-validation. The source separates mean, naive, seasonal naive and drift methods and treats evaluation as distinct from fitting. All quarterly, smoothing and input-variance records here are original Academy constructions. The existing original AR1and reconciliation teaching is preserved, not borrowed from a publisher.

Optional software provenance: Microsoft LINEST documentation was read to confirm coefficient order, optional statistics and the intercept argument. The datasets and reproduction instructions are original; execution in a particular Excel installation is not claimed.

Developed study chapters

Original explanation, worked analysis and progressive optional practice.

Apply the idea

A forecast uses next month's actual supplier cost while pretending to predict from today.

What is the modeling failure? Explain your reasoning, then identify one changed fact that could alter the conclusion.

Advanced worked record — a separate fictional scenario: For the fictional sequence 10,12,11,14,13,15, compare one-step forecasts at times 4,5,6. A last-observation method predicts 11,14,13, giving actual-minus-forecast errors 3,−1,2 and MAE=2. A trailing-three mean predicts 11,37/3,38/3, giving errors 3,2/3,7/3 and MAE=2. Both have MAE 2, but the sums of squared errors are 14 and 134/9≈14.8889 respectively. The methods tie under absolute loss and differ under squared loss. A centered three-point mean would use the target or later data and is not a valid alternative at those forecast origins.

Independent transfer: If under-forecasting costs 3 units per unit and over-forecasting costs 1, calculate each method's total loss over the three origins. Explain why three errors are insufficient to establish broad forecasting superiority.

Expanded transfer investigation: A forecast regression needs next month's weather. Which evaluation matches real deployment?

Show the calculation or argument, identify the information available at the decision time, and state which assumption supports your conclusion. The four progressive tasks in the Learn stage provide additional practice.

Read the worked reasoning

Future-information leakage. Inputs must have been available at the forecast date. In an independent response, state the given facts, identify the governing relationship, work through the calculation or comparison, and distinguish the conclusion from assumptions that still need evidence.

Advanced transfer reasoning: The last-observation losses are 9,1,6, totaling 16. The trailing-mean errors are all positive, so losses are 9,2,7, totaling 18. The preferred method depends on the stipulated cost. Three selected origins provide little evidence about seasonality, change or rare large errors; retain a wider predeclared evaluation and examine dependency.

Expanded transfer reasoning: Unknown future inputs must be forecast or conditioned on as scenarios, with appropriate uncertainty treatment.

Progressive practice reasoning: The next smoothed level is 0.5(130) + 0.5(112.5) = 121.25. Forecasting receipts requires invoice timing, payment terms, partial payments, collection delays, refunds, and opening receivables as appropriate. A defensible specification could target next month's collected dollars at each month-end, using only then-available invoices and payment history, compared with a seasonal naive baseline on chronological origins. Score absolute dollar error, shortfall loss, and interval coverage. Review after sustained bias or a documented process change rather than promising that one favorable test period proves permanent accuracy.

Check understanding

At the end of month 4, observed demand is [100,110,105,120]. What is the three-month moving-average forecast for month 5?

  1. About 118.333
    Feedback

    Incorrect. This uses the future month-5 outcome of 130 from the teaching sequence.

  2. About 111.667
    Feedback

    Correct. Average the last three available observations: (110+105+120)/3.

  3. 120
    Feedback

    Incorrect. 120 is the naive forecast, a different valid benchmark.

Further reading

Required teaching and complete optional models are supplied on LawfareGroup.com. Publisher and primary links are optional provenance or further reading. Florida is the contemporary state-law default; federal rules and explicitly comparative accounting frameworks are distinguished. Independent subject review and observed human learner testing remain pending.

My learning →