Front Matter
F1 · Foreword

Why This Book Exists

"They asked me to summarize a century of time-series thinking. I said: first we modeled the noise, then we filtered it, then we learned it, and now we let it decide what to do next."

A Kalman Filter That Trusts the Measurement Too Much

Time is the hidden axis of intelligence. Every interesting decision a system makes, whether it predicts tomorrow's electricity demand, reads a patient's vital signs as they evolve, prices a portfolio under shifting volatility, or steers a robot through a changing room, is a decision about a world that does not hold still. Strip the temporal dimension away and you are left with a snapshot; restore it and you have a story, with memory, momentum, regime changes, and consequences that arrive long after the action that caused them. This book is about building machines that live inside that story rather than glancing at single frames of it.

For most of its history, the study of time unfolded in separate rooms that rarely spoke to one another. Statisticians built the classical edifice of forecasting: stationarity and autocorrelation, ARIMA and exponential smoothing, spectral analysis, the Kalman filter and the hidden Markov model. Deep learning arrived and rebuilt sequence modeling from the activation up: recurrent networks, temporal convolutions, attention, and the structured state-space models that now rival them. A third community, working on foundation models, discovered that a single pretrained network can forecast series it has never seen, the way a language model completes a sentence it has never read. And a fourth tradition, reinforcement learning and optimal control, treated time as a sequence of decisions rather than observations, asking not only what comes next but what to do about it.

The trouble is that these four bodies of knowledge are almost always taught apart. The forecasting texts stop before deep learning begins. The sequence-modeling tutorials start at the tensor and never look back at the autocorrelation function. The reinforcement-learning books treat the Markov decision process as a fresh invention rather than the close cousin of the state-space model two shelves over. A practitioner assembling a real temporal system must stitch these fragments together alone, usually under deadline, usually by trial and error, and usually without noticing that the same idea has been handed to them three times under three different names.

This book exists to close that gap. It tells classical forecasting, temporal deep learning, foundation models, and sequential decision making as one connected story rather than as a forecasting-only text with a few neural chapters bolted on. The organizing claim is simple: these are not four subjects but one, and the one has recurring characters. The Kalman filter you meet as a recursive estimator returns as the recurrent neural network, which trains by gradient descent what the filter sets by hand, and returns again as the structured state-space model, a Kalman-like recurrence made deep and parallel. The hidden Markov model returns as the neural latent-variable model and again as the belief-state agent that must act without seeing its full world. ARIMA's linear recurrence reappears inside linear attention. Spectral analysis resurfaces in frequency-domain forecasters. The Markov decision process, the workhorse of control, returns as a plain sequence model in the Decision Transformer, which conditions on a desired return and predicts the action that achieves it.

Read in sequence, each return visit feels like recognition rather than revelation. When you reach the recurrent network you already understand recursive estimation, so the LSTM is a refinement, not a mystery. When you reach reinforcement learning you already understand belief tracking, so partial observability is a familiar problem in new clothes. We make these bridges explicit, chapter to chapter, so you leave with one mental model of temporal computation rather than a catalogue of disconnected tricks.

There is a practical argument too, and working engineers feel it most sharply. The person debugging a forecaster that collapses after a holiday needs seasonality and stationarity, not another architecture. The person whose model degrades silently in production needs concept-drift detection and proper scoring, not a bigger transformer. The person fine-tuning a temporal foundation model ships better results faster when they understand what a lag feature, a leakage boundary, and a calibration curve actually are. Modern libraries are so capable that you can operate them blind, and that is exactly when foundations matter most: the library handles the common case, and your job begins where the common case ends.

Why write this book now? Because the foundation-model wave has pulled an enormous new audience into temporal modeling, many of them arriving from software engineering, data science, or language work, while the on-ramps have not kept pace. Pretrained forecasters, conformal uncertainty, and decision-making sequence models are remarkable, but they are the top floors of a building. This book walks you up the stairs, floor by floor, from the autocorrelation function to the planning agent, and points out which beams carry the weight. It is written for builders: every concept that can be run is run, every from-scratch derivation is paired with the production library call, and the whole journey converges on a capstone that asks you to put forecasting, representation, uncertainty, and decision making to work in one honest end-to-end system. That is why this book exists. Welcome to it.