advanced26 min studyLesson 836 in Engineering

Make simple forecasts operationally honest

Implement seasonal repetition and freshness-aware fallbacks as deployable comparison systems.

On this page

What you’ll understand

  • Compute seasonal naive forecasts beyond one seasonal cycle.
  • Handle an unavailable seasonal anchor explicitly.
  • Compare a learned model with a baseline under identical issue conditions.

A sophisticated demand model is difficult to justify if yesterday at the same hour predicts just as well with fewer operational failures. Yet the baseline must obey the same information boundary as the learned system. A seasonal value copied from a fully revised historical table may be unavailable in the real service, while a baseline that silently returns zero during outages can conceal its own failures. Treat each baseline as a complete forecasting policy with a target definition, calendar rule, missing-anchor behavior, latency budget, and immutable prediction record.

Repeat the correct seasonal position

For a regular series with seasonal period m, seasonal naive forecasting repeats the most recent observed value from the same seasonal position. For horizons longer than m, it continues repeating the last observed cycle rather than reading future actuals from the evaluation table. The index formula should point to a time no later than the forecast origin. Write a short trace for horizons m, m+1, and 2m; these boundary cases reveal many incorrect implementations of a superficially simple method.

The seasonal position must match the operational calendar. A seven-day lag may preserve weekday but miss a movable holiday; a twenty-four-hour elapsed-time lag can differ from the same local clock hour around daylight-saving changes. Define whether the baseline uses elapsed slots, local calendar matching, or a holiday-aware lookup. Do not add calendar exceptions after seeing a test failure and then describe the result as an untouched benchmark. Version each exception and select its policy on earlier data.

y^t+h∣t=yt+h−m⌈h/m⌉,h≥1\hat y_{t+h\mid t}=y_{t+h-m\lceil h/m\rceil},\qquad h\geq1
m and h are positive integer periods, with a regular grid and a fully available last seasonal cycle ending at t. The selected anchor lies between t−m+1 and t. Predictions and observations share the target units.↔ Scroll wide equations horizontally.

Give the fallback an information contract

Availability can invalidate the usual seasonal anchor. If the relevant last-cycle value is not yet usable, decide in advance whether to use an older same-position value, a recent-level baseline, or a degraded response. This is a different policy from textbook seasonal naive with complete history, so name it clearly in evaluation. Record which anchor was actually chosen and its usable version. Otherwise an availability-aware baseline can be accidentally compared with a learned model that saw richer inputs.

A hierarchy of fallbacks should terminate. For example, try one-cycle-old same-position demand, then two-cycle-old demand, then a training-only median, and finally an explicit unavailable state. Set a maximum allowed anchor age and a rule for new entities with no history. A baseline that always emits a number is not automatically more reliable than one that reports insufficient evidence. Include forecast coverage and degraded-mode frequency in the comparison, alongside the accuracy of values that were actually issued.

k∗=min⁡{k∈{1,…,K}:t+h−km≤t, a(yt+h−km)≤τ}k^*=\min\{k\in\{1,\ldots,K\}:t+h-km\leq t,\ a(y_{t+h-km})\leq\tau\}
This separately defined availability-aware seasonal lookup searches at most K earlier cycles and chooses the nearest usable same-position anchor. τ is issue time and t is the nominal origin index. If the set is empty, the policy must invoke another explicit fallback.↔ Scroll wide equations horizontally.

Compare systems under equal conditions

Issue baseline and model predictions for the same origins, targets, truth versions, and serving deadlines. Include cases in which either path fails. A model that improves mean absolute error only when its large feature join succeeds may still lose operationally after its fallback behavior is included. Measure end-to-end decision quality under the intended action policy, while retaining pure forecasting metrics so the source of any benefit can be understood.

Break baseline performance down by season, regime, entity age, and forecast horizon. A seasonal repeater can be strong during stable weekly operations and weak after a permanent workload migration. A recent-value baseline may react faster to a level shift but miss a predictable weekday pattern. These failures provide useful diagnostic structure for a learned model: beating one aggregate number is less informative than demonstrating which predictable patterns it captures and which operational conditions still force a fallback.

Repeat a four-period cycle without future reads

At origin t=12, the fully usable last cycle of length m=4 is y₉=10, y₁₀=20, y₁₁=30, y₁₂=40. Compute seasonal naive predictions for horizons 1, 4, and 6 using the regular-grid formula.

  1. For h=1, ceil(1/4)=1 and the anchor index is 12+1−4=9. The prediction is therefore 10, matching the next seasonal position.

  2. For h=4, ceil(4/4)=1 and the anchor is 12+4−4=12. The prediction is 40, the final position in the observed cycle.

  3. For h=6, ceil(6/4)=2 and the anchor is 12+6−8=10. The prediction is 20. Reading y₁₄ instead would consume a future observation and would not be a forecast.

The result

The baseline repeats the same last observed cycle even beyond one season. It never advances its anchor into unobserved evaluation outcomes.

Explore the model

Interactive lab

Interactive lab · modular

Track seasonal positions explicitly

Reset, set Modulus m to 4 and Additive step a to 1. Predict residues 1,2,3,0 after four successive Steps and period 4. Reset, set m=4 and a=2, then take two Steps: predict residues 2,0 and period 2. This exact additive orbit illustrates seasonal-slot indexing; it does not choose historical demand anchors or implement calendar exceptions. Each fresh run sets both controls after Reset.

Track seasonal positions explicitlyAddition modulo m starts at zero: rₙ = na mod m. Playback advances two additions per second. The orbit has period m/gcd(m,a), including period one for a = 0. This is not a cryptographic security test or a primality algorithm. Current readings: Residue r0: 0; Orbit period · m/gcd(m,a): 12; Distinct residues visited: 1 of 12. All parameters are adjustable with the labeled controls below.Repeated addition modulo 12: the current residue is 0, and the orbit period is 12.01234567891011+ 5mod 12An additive orbitn = 0rₙ = 0Period = 12Cycle starts at 0:0 → 5 → 10 → 3 →8 → 1 → 6 → 11 →4 → 9 → 2 → 7 → 0Exact residues · two additions per second
Additive orbitCurrent residue / next edge
Residue r0
0
Orbit period · m/gcd(m,a)
12
Distinct residues visited
1 of 12
t = 0 s

Addition modulo m starts at zero: rₙ = na mod m. Playback advances two additions per second. The orbit has period m/gcd(m,a), including period one for a = 0. This is not a cryptographic security test or a primality algorithm. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forCadence and seasonal indexing determine which positions a baseline actually visits.

Check your understanding

With m=4 and the example’s origin 12, which observation anchors horizon 6?

Try it yourself

Use m=7, origin t=28, and horizon h=9. The ordinary seasonal-naive anchor is usable and equals 80 requests. Find its index. If that anchor is unavailable but the previous same-position value at index 16 is usable and equals 70, what does the declared older-cycle fallback return?

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

Compute ceil(9/7), then move backward by one additional full cycle if the ordinary anchor is ineligible.

Compare with the solution

The ordinary anchor index is 28+9−7×2=23, so complete-history seasonal naive predicts 80. Under the separate availability-aware fallback, an unavailable index 23 is skipped and index 16 supplies 70. Report that older anchor and fallback status; do not claim the two policies issued identical forecasts.

Take it with you

  • Repeat observed seasonal positions across every requested horizon.
  • Specify calendar rules and missing-anchor fallbacks before evaluation.
  • Compare baselines and learned systems on the same operational cases.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.