Lawfare Group → Knowledge Institute → Lawfare Academy
← Regression Analysis for Business
Unit 5
Time structure and validation
Learning objectives
- Explain time structure and validation in your own words.
- Apply the principle to the worked business case.
- Evaluate the answer and identify an assumption that could change it.
Time structure and validation
Autocorrelation affects inference and forecasting. Use time-aware validation and avoid look-ahead bias. Fixed effects or time controls answer particular conditional questions and do not automatically solve every identification issue.
Worked example
Randomly splitting a strongly time-ordered forecasting dataset leaks future patterns into evaluation.
Current on-site learning
All required original teaching, complete derivations and optional practice models are on LawfareGroup.com. External references are optional provenance or further reading. Florida is the state-law default; federal, historical and comparative contexts remain distinct. Independent human subject review and observed learner testing remain pending. Synthetic economic models establish no actual market response, legal clearance or professional competence.
Work through the reasoning
Define the population, sampling or assignment process, variables, estimator, and intended inference. For this unit, connect the explanation of time structure and validation 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 preferable for forecasting assessment? 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.
Extended text lesson
Continue with Validate using information that existed at the forecast date for the full worked case, source readings and optional progressive practice.
Complete current conceptual preparation
Time-aware transformations, forecasting and loss
The original companion's 12,14,16,18,20,22,40,42 series, fixed versus rolling protocols and separate 100/120/80 business-loss example remain intact. This studio supplies the broader transformation, time and evaluation preparation with a new Willow series. A favorable training fit never establishes that an earlier operational forecast could have been produced from the information actually available then.
Build an information-time specification
Distinguish event date, recording date, revision date and forecast issue date. A feature must be available in usable form when the prediction is issued. A later paid status, revised statistic or retrospective group category can leak outcome information. A chronological split does not repair a feature pipeline built from the full dataset. Fit imputation, scaling, category handling, transformations and tuning within the permitted training information and reproduce that rule at each origin.
Serial correlation means observations or errors at different dates share information under the specified model. Trends, seasonality, persistent shocks and changing variance can affect both forecasts and uncertainty. Common time controls or unit fixed effects remove particular modeled components; they do not guarantee independent errors, stationary dynamics or causal identification. Differencing changes the target and available information rather than acting as a universal cure for a time pattern.
Choose the promised task: one fixed-origin future block, repeated one-step forecasts after updating, or a rolling multi-step horizon. Expanding windows retain all available past data; moving windows discard earlier data according to a stated rule. Benchmark and candidate must use matching issue dates, horizons and update opportunities. Reserve evaluation information from tuning, or describe the search and use another appropriate evaluation. If deployment predicts new customers as well as future dates, the split must also represent that distinction.
Transformations change prediction targets
A transformation can stabilize scale, respect positivity or express a substantive relationship. Logarithms require positive inputs. A Box-Coxfamily on its appropriate positive domain can use log(y)at lambda 0 and(y^lambda−1)/lambda for nonzero lambda. The inverse is exp(w)at zero and(lambda w+1)^(1/lambda)where defined otherwise. The model, domain and chosen lambda are assumptions or fitted choices that must be recorded; arbitrary additions to handle zeros change the relationship.
For a monotone transformation, an appropriately justified prediction interval can be mapped back by transforming its endpoints. Coverage carries through the same event under the transformation; this does not repair an invalid interval on the transformed scale. A back-transformed central prediction need not equal an arithmetic mean. If log Y is normal with conditional mean mu and variance v, its level mean is exp(mu+v/2), while exp(mu) is its median. Other distributions need another argument. The original companion's finite 50/200 example gives a direct demonstration without assuming lognormal errors.
Use independent Willow equally likely levels 80 and 320. Their log center is log 160, so exponentiating that center gives 160; the arithmetic mean is 200. The finite residual-exponential average is 1.25. A common retransformation factor does not automatically work when the residual distribution differs by group or horizon. Define whether the decision needs a median, expected total, quantile or another functional before selecting the output.
The relevant methodological explanations in Forecasting: Principles and Practice chapter 5 sections 5.6,5.8 and 5.10 were consulted for transformation targets, evaluation and time-ordered validation. Historical datasets, figures, package output and universal holdout proportions are not adopted as empirical evidence or required runtime behavior. This studio and the preserved full original applications supply all required methods on site.
Independent Willow fixed and rolling forecasts
Let periods 1 through 6 have outcomes 2,4,6,8,14,16. Fitting the first four gives trend yhat=2 t. From fixed origin 4 it predicts 10 and 12 for periods 5 and 6. Forecast-minus-actual errors are−4 and−4, MSE 16 and MAE 4. A matching fixed last-value benchmark predicts 8 and 8, errors−6 and−8, MSE 50 and MAE 7. Both forecasts use information only through period 4.
For a rolling one-step protocol, predict period 5 as 10, then refit after observing 14. With the first five values, the fitted intercept is−1.6 and slope 2.8, so period 6 forecast is 15.2. Errors are−4 and−0.8, giving MSE 8.32 and MAE 2.4. The matching rolling last-value benchmark predicts 8 then 14, giving MSE 20 and MAE 4. Report each within-protocol comparison separately. Comparing rolling 8.32 with fixed 50 would give the candidate an extra information advantage.
This six-value construction audits mechanics, not stable forecasting superiority. Its perfect initial fit misses a later change. More origins, relevant regimes, outcome completeness and uncertainty matter. Overlapping multi-step errors can be dependent, so uncertainty for average evaluation loss also needs a design argument. A point score by itself supplies neither a calibrated prediction distribution nor a causal effect.
Scores should match units and the decision
MAE averages absolute errors; MSE averages squared errors and RMSE is its square root. The mean minimizes expected squared loss under suitable finite moments, while a median minimizes expected absolute loss. Asymmetric loss can target another quantile or a constrained action. A capacity or inventory choice should be evaluated through its actual feasible decision rule and consequences, not only a symmetric forecast score.
Percentage errors divide by the actual outcome, so zero or near-zero actuals can make them undefined or unstable; scales without a meaningful zero make percentage interpretation problematic. Scaled errors use a stated training benchmark error as their denominator and require it to be nonzero. For fixed-origin Willow, the training naive absolute differences are 2,2,2, giving scale 2. Candidate MAE 4 has MASE 2 and benchmark MAE 7 has MASE 3.5. For a rolling protocol, declare how the scaling denominator updates; do not silently mix denominators from another evaluation.
Prediction intervals concern the distribution of future outcomes under specified information. Check interval coverage and width across relevant horizons or groups, not only point accuracy. A wider interval can improve coverage while becoming unhelpful; use a justified interval scoring or decision criterion where needed. Record how forecasts are revised without rewriting past evaluations as if the final model had been known earlier.
Optional complete models
Model 1 — Extra future information is given only to the favored model
Willow fixed-origin trend MSE 16 must be compared with fixed benchmark 50. Rolling trend 8.32 compares with rolling benchmark 20. Changed fact: the operational product updates after every observed outcome. Select the matching rolling task for both methods and retain the one-step horizon. Do not claim 8.32 versus 50 as a fair model improvement.
Model 2 — The log center is called expected level revenue
For Willow levels 80 and 320 with equal probability, exp(meanlogY)=160 and meanY=200. Changed fact: one group's conditional residual distribution changes. Recompute or model that group's level mean rather than borrow 1.25 as a universal multiplier. A correctly interpreted log coefficient can still fail to answer the expected-total decision.
Model 3 — A percentage metric is applied to zero outcomes
Define the actual denominator before interpreting an error percentage. With actual zero the usual absolute percentage error is undefined. Changed fact: the training naive error scale is also zero because all training values are identical. A scaled-error metric can also fail. Choose and justify a compatible measure or report the limitation; adding a convenient constant changes the score and does not automatically preserve its meaning.
Optional rubric 20 points: information dates and transformations 4; exact fixed/rolling reconstruction 4; valid matching benchmarks 4; units/loss/interval interpretation 4; changed-fact revision 4. These models establish no actual business or learner performance. Human subject review and observed learner testing remain separately pending.
Apply the idea
Randomly splitting a strongly time-ordered forecasting dataset leaks future patterns into evaluation.
What is preferable for forecasting assessment? Explain your reasoning, then identify one changed fact that could alter the conclusion.
Read the worked reasoning
Chronological validation appropriate to deployment. The evaluation should resemble the future prediction problem. 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.
Check understanding
What is preferable for forecasting assessment?
- Any random split regardless of timing
Feedback
This alternative does not follow from the stated facts. The evaluation should resemble the future prediction problem.
- Training fit alone
Feedback
This alternative overlooks the relevant mechanism. The evaluation should resemble the future prediction problem.
- Chronological validation appropriate to deployment
Feedback
The evaluation should resemble the future prediction problem.
Further reading
All required original teaching, complete derivations and optional practice models are on LawfareGroup.com. External references are optional provenance or further reading. Florida is the state-law default; federal, historical and comparative contexts remain distinct. Independent human subject review and observed learner testing remain pending. Synthetic economic models establish no actual market response, legal clearance or professional competence.
- Complete on-site teaching — Time-aware transformations, forecasting and loss
- Introductory Business Statistics 2e — 13.5 Interpretation of Regression Coefficients: Elasticity and Logarithmic Transformation
- Advanced companion: MIT OpenCourseWare — Data, Models, and Decisions
- Validate using information that existed at the forecast date