Time series and forecasting · insight-0253
Build an explicit time grid so missing periods are not mistaken for zeros or skipped
- Evidence type
- practitioner heuristic
- Difficulty
- easy
- Roles
- Data analyst, Data scientist
- Industries
- aviation, manufacturing, energy
Summary: situation, action, reason, boundary
Situation
A route's daily table has a nine-day gap where no rows exist, and the lag-7 feature is computed with row offsets.
Action
Reindex every series to a complete calendar at its frequency, mark missing periods explicitly, decide per cause whether they are true zeros, unknown values to impute, or periods to exclude, and compute lags by date.
Reason
Missing timestamps and true zeros mean different things, and most lag, seasonal and metric computations assume a regular grid.
Boundary
Operational logs, sensor feeds, raw transaction extracts, panels with store closures.
Symptom or risk
Row-based lags silently point to the wrong dates across the gap, and filling the gap with zeros invents a demand collapse.
Exceptions
Event-based models designed for irregular timestamps can work without a grid, but still need the gap explained.
Trade-offs
Imputing gaps keeps series continuous but can create false certainty; flag imputed points in features.
Pitfalls
Counting imputed values as actuals when computing accuracy.
Example
The synthetic flight_day_raw table has a nine-day IST-TZX gap from 2023-03-04 to 2023-03-12.