A lag turns an earlier value in a time series into a feature for a later prediction. For sales forecasting, that might mean using an item’s sales from a previous day or week to predict its future sales. Lags are one option alongside rolling-window aggregates such as means, maxima, and minima. section 11.1.2 section 8.6.1
A weekly sales baseline
To predict an item’s sales on September 8, use its actual sales at the same grocery on September 1. Going back a full week rather than one day accounts for weekly seasonality and the possibility that recent sales data arrives late. section 8.6.1
More lags can capture more complex patterns and seasonalities, but they also make overfitting easier. Compare validation error across choices such as the previous one to three days versus the previous 30 days, using a model-size-versus-error curve. Lag count is a model-complexity choice, not a reason to include every available past value. section 9.4.1
A linear forecasting baseline can combine multiple lags with rolling sums, averages, medians, extrema, or quantiles. The same approach can use past values of changing inputs such as price, revenue, and customer counts—not just past sales. section 8.6.1




