A field guide · part two / from the past to the next value
A time series tells you where something has been. Forecasting is the harder, more useful art of saying where it goes next, and being honest about how sure you are. This is a plain-language tour of the methods, from the humble baselines you must beat to deep global models, and the evaluation discipline that keeps all of them honest.
Section 01
To forecast is to use what a series has done so far to estimate what it will do next. Given values up to today, you produce one or more future values: tomorrow's demand, next month's temperature, the health of a bearing three weeks out. The number of steps ahead you reach for is the horizon, and almost everything about the difficulty of a forecast scales with it. One step ahead is often easy. Fifty steps ahead, the future fans out into a wide cloud of possibilities.
Two ideas separate good forecasting from wishful thinking. The first is that a forecast is only meaningful next to a statement of uncertainty. A single number with no interval around it hides exactly the information a decision needs. The second is that forecasting is forward-looking by nature, so it can only be judged on data the model never saw. Fit quality on the past is almost worthless; performance on a genuine hold-out is everything.
Second in a series
This monograph follows Time Series as Sensory Data, which covered how raw signals become clean, ordered numbers. That groundwork (sampling, decomposition, autocorrelation, stationarity, residuals) is the vocabulary we lean on here. If a term like autocorrelation or stationary feels unfamiliar, the companion page builds it from scratch.
The landscape of methods is large but not chaotic. It sorts into a few families, and a good forecaster picks a family to match the series and the stakes, rather than reaching for the most fashionable tool. Here is the map we will walk.
Figure 1. The method families. We start at the bottom-left, the simplest classical tools, and work toward the machine-learned right, because the simple methods set the bar everything else has to clear.
Section 02
Before any model earns its keep, it has to beat a method so simple it takes one line to describe. These baselines are not strawmen; on many real series they are shockingly hard to outperform, and a fancy model that loses to them is worse than useless because it costs more and hides its failure behind complexity.
Tomorrow equals today. The forecast for every future step is just the last observed value. Brutally simple, often the one to beat.
This July equals last July. Repeat the value from one full season ago. The right baseline whenever a clear cycle exists.
The future equals the historical average. Sensible only when the series has no trend and no season, just noise around a level.
Extend the straight line from the first point to the last. A naive forecast that is allowed to keep trending.
Switch between them below on a series with both a trend and a yearly season. Watch how naive ignores the season, mean ignores everything, drift catches the slope but not the cycle, and seasonal naive quietly does well, all without estimating a single parameter.
Section 03
The single most common way to fool yourself in forecasting is to test on data the model already learned from. Because a time series has an arrow, you cannot shuffle it into random train and test folds the way you would for ordinary data; that would let the model peek at the future to predict the past, a mistake called leakage. Evaluation has to respect time.
The honest scheme is rolling-origin evaluation, also called time-series cross-validation or backtesting. You pick an origin, train only on data before it, forecast the block just after it, record the error, then slide the origin forward and repeat. Every test block sits strictly in the future relative to its own training data, exactly as it will at deployment. You can let the training window grow (expanding) or hold it to a fixed length that slides along (sliding). The diagram below is live: change the folds and horizon and watch the blocks march forward in time.
Practical note · the leakage that hides in features
Leakage rarely comes from an obvious shuffle. It sneaks in through features: a rolling mean computed with a centered window peeks ahead, a scaler fit on the whole series carries future statistics into the past, a "known future" covariate like a holiday flag is fine but a "demand last week" feature computed wrong is not. The rule is simple and unforgiving: every input to a forecast for time t must be computable strictly from information available at time t.
Section 04
Once you forecast honestly, you need a number for the error, and the choice of number quietly shapes which model wins. The two workhorses are MAE, the mean absolute error, and RMSE, the root mean squared error. They differ in temperament: MAE treats all misses proportionally, while RMSE squares them first, so it punishes a few large errors far more than many small ones. If a single bad miss is catastrophic, optimize RMSE; if all errors hurt equally, MAE is more faithful.
Percentage errors like MAPE are tempting because they are unit-free and easy to explain, but they have a sharp edge: when the actual value approaches zero, the percentage explodes toward infinity, and the average becomes meaningless. sMAPE softens this a little, and MASE sidesteps it entirely by scaling your error against the naive baseline, so a MASE below one means you beat naive and above one means you lost. Push the series level toward zero below and watch MAPE detonate while MASE stays sane.
Section 05
The first real method family is built on one elegant idea: a forecast should be a weighted average of past observations, with the weights fading exponentially into the past. The most recent point matters most, the one before slightly less, and so on. The plainest version, simple exponential smoothing, tracks a single evolving level with one knob, the smoothing rate alpha. A high alpha reacts fast and trusts the latest point; a low alpha is sluggish and trusts the accumulated past.
Real series have more than a level, so the idea is extended. Add a trend component (Holt's method) and the forecast can slope upward or downward. Add a seasonal component (Holt-Winters) and it can carry a repeating yearly or weekly shape forward. Each component gets its own smoothing rate, updated every step from the newest data.
The simulation runs genuine additive Holt-Winters on the history and projects across the horizon. Turn the three knobs and feel the tension: too much smoothing and the forecast lags behind real change; too little and it chases noise into the future.
Section 06
The other great classical family models a series through its own correlations. An autoregressive term (the AR in ARIMA) says the next value is a weighted sum of recent past values plus a shock: today leans on yesterday and the day before. A moving-average term (the MA) says the next value also carries an echo of recent random shocks. The middle letter, the I for integrated, is differencing: instead of the raw series you model its changes, which is how ARIMA tames a trend and works with the stationary signal underneath.
Two diagnostic plots from the companion page guide the choice of orders: the autocorrelation function and its partial cousin reveal how many AR and MA terms the data wants. The simulation below builds a genuine AR(2) process you control, fits the coefficients back from the training data by least squares, then forecasts recursively. Notice the signature behavior of every stationary autoregressive forecast: it decays back toward the series mean as the horizon grows, because the model has no information about the far future beyond "it will look average".
Practical note · ETS or ARIMA?
The two classical families overlap more than their different vocabularies suggest, and many series are served well by either. A rough guide: reach for exponential smoothing when the structure is clearly level-plus-trend-plus-season and you want robust, almost tuning-free behavior; reach for ARIMA when the autocorrelation structure is richer or you need its statistical machinery for intervals and tests. In practice, automated routines that search the ETS and ARIMA spaces and pick by an information criterion have made the choice far less agonizing than it once was.
Section 07
How do you know how many autoregressive or moving-average terms a series wants? You ask the data, through two diagnostic plots. The autocorrelation function (ACF), met in the first monograph, measures how a series correlates with itself at each lag. The partial autocorrelation function (PACF) measures the correlation at a lag after removing the influence of all the shorter lags in between, isolating the direct link.
The two plots have a famous signature. For a pure autoregressive process of order p, the PACF cuts off sharply after lag p while the ACF decays gradually; for a pure moving-average process of order q, it is the mirror image, the ACF cuts off after q and the PACF trails away. Real series are messier, but this pattern is the first thing a forecaster reads off the correlogram. Build an AR process below and watch the PACF snap to zero past its true order while the ACF tapers.
Section 08
Most classical methods assume the series is stationary: its mean, variance and correlations do not drift over time. Real series rarely oblige, and the most common cure is differencing, working with the change from one step to the next instead of the raw value. A single difference flattens a linear trend; a second difference handles a curving one; a seasonal difference, subtracting the value one season ago, removes a repeating cycle. The "I" in ARIMA is exactly this operation, applied before the AR and MA machinery sees the data.
The art is to difference enough to reach stationarity but no more, since over-differencing injects its own artificial structure. The simulation takes a trended, seasonal series and applies the differencing you choose, reporting how the variance settles once the trend and season are removed.
Section 09
A different and very intuitive strategy is to split the series into its ingredients, forecast each one separately, then add them back together. The companion page showed how a signal decomposes into trend, season and remainder; here we put that decomposition to work for prediction. Estimate the slow trend, estimate the repeating seasonal shape, and the leftover is a small stationary residual. To forecast, extend the trend forward, tile the seasonal shape across the horizon, and add the (usually near-zero) residual forecast on top.
The appeal is transparency. Each piece of the forecast has a clear meaning you can sanity-check and explain to a stakeholder: this much is the underlying growth, this much is the seasonal swing. The risk is that the trend extrapolation, often a straight line, can run away over long horizons, so decomposition forecasts are usually trusted more for their seasonal shape than their long-range level.
Section 10
A point forecast is half an answer. The half that matters for a decision is the range: how far could the truth plausibly fall from the central guess? A prediction interval states that range with a probability attached, an 80 percent interval is meant to contain the actual value four times out of five. The width of the interval is not decoration; it is the forecast's confession of how much it does not know.
Intervals share one universal feature: they widen with the horizon. One step ahead, the model is anchored to the freshest data and the interval is tight. Far ahead, errors compound and the interval flares into a fan. The simplest honest construction takes the spread of the model's one-step errors on the training data and grows it with the horizon, often like the square root of the number of steps for a random-walk-like series. The simulation draws nested 50, 80 and 95 percent bands and reports how often the held-out truth actually lands inside the outer one, the property that separates a calibrated interval from a comforting fiction.
Section 11
The fan chart of the previous section assumed the errors were Gaussian and that the model's own variance estimate was trustworthy. Both assumptions fail quietly and often, leaving intervals that are too narrow exactly when it matters. Conformal prediction sidesteps the problem with a guarantee that holds no matter what model produced the point forecast and no matter how the errors are distributed.
The recipe is almost suspiciously simple. Hold out a calibration set the model never trained on. Record the absolute error of the point forecast on each calibration point, the nonconformity scores. To build a 90 percent interval for a new forecast, pad it by the 90th percentile of those scores. Because the new point and the calibration points are exchangeable, the resulting interval covers the truth about 90 percent of the time, by construction rather than by assumption. The simulation forecasts a holdout span and sizes its conformal band from the calibration residuals, then measures the coverage actually achieved.
Section 12
A symmetric band assumes the future is equally likely to surprise you high or low. Often it is not: demand can spike far above its median but rarely falls below zero, and the cost of under-forecasting may dwarf the cost of over-forecasting. Quantile forecasting drops the symmetry and predicts the percentiles directly, say the 10th, 50th and 90th, letting the interval be lopsided when reality is.
You cannot train a quantile forecaster with squared error; that only ever learns the mean. The right objective is the pinball loss (the quantile loss), which is tilted so that for the 90th percentile, falling short is penalised nine times as heavily as overshooting. Minimising it pins each prediction to its intended quantile. The simulation shows the three quantile forecasts and reports the pinball loss as you make the underlying noise asymmetric.
Section 13
An interval is only as good as its honesty. If you ship 90 percent intervals that actually contain the truth 70 percent of the time, you are over-confident, and every downstream decision inherits a risk it does not know about. The diagnostic is the reliability diagram: for each nominal coverage level you intended, plot the empirical coverage you achieved. Perfect calibration lies on the diagonal.
A curve sagging below the diagonal means intervals that are too narrow; bulging above means they are needlessly wide and you are wasting precision. The simulation sweeps the nominal levels and plots achieved against intended coverage for a forecaster whose spread you can mis-set, so you can see over- and under-confidence directly.
Section 14
Machine learning enters through a simple reframing: turn the time series into an ordinary table. For each point, build a row of features from its past, the last few values (called lags), the value one season ago, rolling averages, calendar facts like day-of-week, and let the target be the next value. Now any regressor, a linear model, a gradient-boosted tree, a neural network, can learn the mapping from past to future. This is how tree ensembles came to dominate several large forecasting competitions.
Reaching multiple steps ahead forces a choice. The recursive strategy forecasts one step, feeds that prediction back in as if it were real, and repeats, simple but it lets errors compound. The direct strategy trains a separate model for each horizon, no feedback, but many models to fit. The simulation runs a genuine lag-feature linear model, fit by least squares on the history and rolled forward recursively. Add lags or switch on a seasonal lag feature and watch the forecast sharpen as the feature set captures more structure.
Figure 15. Two ways to reach multiple steps ahead. Recursive is simple but compounds its own errors; direct avoids feedback at the cost of training and storing many models.
Section 15
The diagram above named two strategies for forecasting several steps ahead. The recursive approach trains one model and feeds its own predictions back in to walk forward, which is simple but lets small errors compound as the horizon grows. The direct approach trains a separate model for each horizon, predicting step h straight from the present, which avoids feedback at the cost of many models. Which wins is an empirical question, so here we settle it by running both on the same series.
The simulation fits a lag regression, then forecasts the same horizon recursively and directly, overlaying the two paths against the truth and reporting each one's error. Stretch the horizon and watch the recursive path drift as its own mistakes feed forward, while the direct forecasts, each trained for its own distance, often hold their line better far out.
Section 16
One of the most reliable findings in the whole field is almost embarrassing in its simplicity: averaging several decent forecasts usually beats any one of them. The members make different errors, and a simple mean lets those errors partly cancel, so the combination is steadier than its parts. This has held up across decades of forecasting competitions, and a plain average is a famously hard baseline to improve on.
The simulation runs four different methods on a series, then forms their equal-weight average. Each member's accuracy is reported alongside the ensemble's, and the combination typically lands at or below the best individual, with far less risk of being the worst. It is the closest thing forecasting has to a free lunch.
Section 17
When you have many related series and enough data, neural networks can learn patterns no hand-built feature set would capture. Recurrent networks (RNNs, and their sturdier variants LSTM and GRU) process a sequence one step at a time, carrying a hidden state that acts as a learned memory of everything seen so far. Convolutional approaches (temporal convolutional networks) instead slide learned filters across time, capturing patterns at several scales in parallel. More recently, attention based architectures let the model look directly at any past step it finds relevant, sidestepping the bottleneck of a single hidden state.
The deeper shift these models brought is not the architecture but the global training idea. Classical methods fit one model per series in isolation. A global model trains a single network across thousands of series at once, so a new or sparse series borrows strength from the patterns learned on all the others. This cross-learning is what powered methods like DeepAR and N-BEATS, and it underlies the recent wave of pre-trained time-series foundation models that aim to forecast a series they have never seen, zero-shot. The trade is the usual one: enormous capacity and data appetite against the simplicity, speed and interpretability of the classical tools.
Figure 18. Left, a recurrent network passing a hidden memory along the sequence. Right, the global idea: one model learns across many series so each forecast draws on shared structure.
The global idea, pushed to its limit, becomes a foundation model: a single network pretrained on an enormous and varied corpus of time series, then asked to forecast a series it has never seen, with no training at all. This zero-shot ambition borrows directly from large language models, and a wave of such models has arrived since late 2024. They cluster into a few architectural families. Decoder-only patched transformers, such as Google's TimesFM, chop the history into patches and predict forward in the native numeric domain. Tokenized-value models, such as Amazon's Chronos and the more recent Chronos-2, scale and quantize the values into a fixed vocabulary and run a language-model-style network over the resulting tokens, with Chronos-2 adding multivariate and covariate support. Masked encoders, such as Salesforce's Moirai and Carnegie Mellon's MOMENT, pretrain by reconstructing hidden spans, and mixture-of-experts variants like Time-MoE route different patterns to different sub-networks for efficiency.
The promise is real: respectable accuracy out of the box on series the model never trained on, turning forecasting from a per-series modelling problem into a model-selection one. But the field has a sobering caveat, and it deserves a place in any honest account. Because these models are pretrained on huge scraped corpora, the benchmarks used to praise them are frequently contaminated, the test series having leaked into the training data. On carefully de-contaminated benchmarks, the measured advantage of the best foundation model over strong classical baselines shrinks dramatically, in some studies to a margin of only a fraction of a percent up to the low double digits. The lesson echoes this whole monograph: a foundation model is another tool to put on the leaderboard, not a reason to retire the baselines. Run it through the same faithful backtest you would demand of anything else, and let the held-out numbers, not the parameter count, decide.
Practical note · do not skip the baselines
The competitions that crowned machine-learning methods also delivered a humbling lesson: deep models win on large collections of related series with rich history, and frequently lose to a well-tuned exponential smoothing or a simple ensemble on a single short series. Complexity is a cost, not a virtue. Earn your way up the ladder of Figure 1 only when a faithful backtest says the extra machinery actually pays.
Section 18
The methods are only half the craft. The other half is a disciplined process that protects you from your own enthusiasm. Almost every successful forecasting effort walks the same loop.
Section 19
Everything in this monograph converges on one ritual. Put every candidate method on the same series, evaluate them all with the same backtest and the same scale-free metric, and rank them. No method earns its place by reputation; it earns it on the leaderboard or not at all. This is the discipline that keeps a forecasting practice honest, and it is worth seeing run end to end.
The simulation backtests six methods at once, from the naive baselines through drift, a smoother and a lag regression, scoring each over rolling folds and sorting them by error. Change the series and the order reshuffles, which is exactly the point: the best method is a property of the data, not a fixed favourite. Watch how often a humble baseline finishes above something far more elaborate.
Section 20
For condition monitoring and vehicle health, forecasting wears a specific and high-stakes mask. The companion page closed on remaining useful life: track a health indicator as it degrades and project when it will cross a failure threshold. That projection is exactly a forecast, and everything in this guide applies, with the threshold turning a continuous forecast into a time-to-event decision.
Two themes from the methods above matter most here. First, intervals are not optional; a maintenance decision rests entirely on the lower edge of the RUL interval, the soonest plausible failure, not the central estimate. Techniques like conformal prediction, which wrap any forecaster in intervals with a coverage guarantee, are increasingly the standard for this reason. Second, the operating context is a covariate: the same degradation rate means different things at different loads and temperatures, so the strongest prognostic forecasters condition on those inputs rather than extrapolating the health indicator in a vacuum.
Detection and forecasting are one pipeline
The residual that raised an alarm in the first monograph becomes, tracked forward, the health indicator you forecast here. Diagnostics answers "is something wrong now"; prognostics answers "when will it matter". They are the same signal read at two horizons, and a mature health-management system runs both: a fast detector watching the present and a forecaster watching the future, each feeding the same maintenance decision.
Section 21
A handful of lessons separate a forecast that survives contact with reality from one that only ever looked good on the training set. None are glamorous, and all are expensive to learn the hard way.
The one-sentence summary
A forecast is a claim about the future scored only by how it does on data it never saw, so build the honest backtest first, carry the uncertainty with the number, and prefer the simple, combined, well-calibrated answer over the clever one that has not yet been tested where it counts.
Section 22
References point to further study; the explanations and simulations above are written and implemented from first principles rather than drawn from any single source.