"You assume my observations arrive on a neat grid, one per tick, fully labelled. I emit them whenever I feel like it, sometimes three at once, sometimes none for a week, and I keep my true state to myself. Build your model accordingly."
A Hidden Markov Model Keeping Its States to Itself
Before you choose a model, classify your data, because the shape of time in your dataset decides which methods are even applicable. A reading every second is not the same object as a clinical lab drawn at irregular hours; a single temperature trace is not the same as a hundred coupled sensors; a stream of clicks in continuous time is not a series at all. This section lays out six axes that, together, locate any temporal dataset: how it is sampled, how many channels it carries, whether it is events or values, whether space matters, whether static context rides alongside the dynamics, and whether its statistics hold still. Each axis points forward to the machinery the rest of the book builds to handle it.
In Section 1.3 we drew prediction, reasoning, and decision making as the three capabilities of temporal intelligence. Before we can predict a temporal signal, however, we must be precise about what kind of temporal signal we hold. Practitioners routinely reach for a tool that assumes one data shape and then quietly force a differently shaped dataset to fit it, and the failures that follow are subtle, because the code runs and produces numbers. The numbers are simply wrong. This section is a taxonomy, deliberately example-rich, that gives names to the distinctions that matter and tells you where each one is treated in depth. Throughout, we use the unified notation introduced in Appendix A, to which every major symbol links on first use.
1. Regular vs Irregular Sampling Beginner
The first and most consequential question is whether observations arrive on an even grid. A regular (uniformly sampled) series is a sequence of values indexed by equally spaced times. We write it
$$x_t, \qquad t = 1, 2, \dots, T, \qquad x_t \in \mathbb{R},$$where the gap between consecutive indices is a fixed sampling interval $\Delta t$ (one second for a 1 Hz sensor, one day for a daily closing price). The index $t$ is an integer count of ticks, and the constant spacing is what every classical model in Part II silently assumes: lagged values $x_{t-1}, x_{t-2}, \dots$ are well defined, an autocorrelation at "lag 5" means a fixed five-second offset, and convolutions and Fourier transforms have a single sampling rate to anchor them.
An irregular (unevenly sampled) series abandons the grid. It is a set of timestamped observations
$$\{(t_i, x_i)\}_{i=1}^{N}, \qquad t_1 < t_2 < \dots < t_N,$$where the inter-arrival gaps $t_{i+1} - t_i$ are themselves random and often informative. Clinical laboratory results are the canonical case: a blood panel is drawn when a clinician orders it, which is more often when the patient is unstable, so the very timing of a measurement carries clinical signal. Financial trades are another: ticks cluster in bursts around news and thin out overnight. Asynchronous logs, satellite revisits, and human-generated events all live here.
In a regular series the timestamps are bookkeeping; you could throw them away and keep only the index. In an irregular series the timestamps and the gaps between them are part of the signal. A model that ignores them, by snapping observations onto an artificial grid, discards information and, worse, can manufacture information that was never there. The "when" is as much a measurement as the "what".
The naive fix, and the one that breaks things, is to resample the irregular set onto a regular grid by binning and interpolation, so that the comfortable machinery of $x_t$ applies again. This forces two distortions. Choosing a grid finer than the typical gap fabricates values by interpolation, inventing a smoothness the patient never exhibited; choosing a grid coarser than the gaps averages away or drops real measurements. Either way the imputed series no longer distinguishes "the value was stable" from "nobody looked". The principled alternative is to model time continuously, treating the observation times as inputs rather than as an afterthought, which is exactly what the continuous-time neural models of Chapter 13 are designed for, and what the time-to-event and point-process methods later in this section formalize.
Who: A machine learning team at a hospital network building an early-warning model for patient deterioration from electronic health records.
Situation: The vitals and labs were irregularly sampled, the heart rate every few minutes when monitored, a lactate value perhaps twice a day, a creatinine result once a day or less, all at clinician-chosen times.
Problem: The team's recurrent model expected a rectangular tensor of shape (patient, timestep, channel), so they resampled everything onto a fixed hourly grid and forward-filled the gaps, carrying each last lab value forward until the next draw.
What broke: Forward-filling made a stale lactate from twelve hours ago look like a fresh, reassuring reading, so the model learned that "lactate is fine" when in truth nobody had measured it. Worse, the model implicitly learned to read the imputation pattern itself: the mere fact that a clinician had ordered a lab was a strong deterioration signal, and forward-filling smeared that timing away. Offline metrics looked excellent because the same leakage existed in the validation split.
Decision: They abandoned the fixed grid, encoded each observation as a (time, value, channel) triple with an explicit "time since last measurement" feature per channel, and added a missingness-indicator mask so the model could see when a value was real versus absent.
Result: Calibration on truly prospective patients improved sharply, and a later migration to a continuous-time model (the Neural CDE family of Chapter 13) removed the imputation step entirely.
Lesson: Irregular data forced onto a grid does not merely lose information; it injects a confound, the imputation pattern, that a flexible model will happily exploit and that will not survive contact with reality.
2. Univariate vs Multivariate Beginner
The second axis counts channels. A univariate series is a single scalar evolving in time, the $x_t \in \mathbb{R}$ above: one thermostat, one stock's daily return, one country's monthly unemployment rate. A multivariate series stacks $d$ channels that evolve together,
$$\mathbf{x}_t \in \mathbb{R}^{d}, \qquad \mathbf{x}_t = (x_t^{(1)}, x_t^{(2)}, \dots, x_t^{(d)})^{\top},$$so each time step is a vector. The reason multivariate data deserves its own category, rather than being treated as $d$ independent univariate series, is cross-series dependence: the channels carry information about each other, and often a leading channel predicts a lagging one. Electricity demand depends on temperature; a currency pair moves with interest-rate spreads; an engine's vibration anticipates its temperature rise. Modelling each channel alone throws away precisely the coupling that makes forecasting possible.
Capturing that coupling is the subject of an entire classical literature, the vector autoregression and Granger-causality machinery of Chapter 6, and of its modern descendants, the temporal graph networks of Chapter 18, which represent the channels as nodes whose edges encode who influences whom. A practical subtlety is that a multivariate series can be regular in one channel and irregular in another, the heart rate sampled densely while the labs arrive sparsely, which means axes one and two combine rather than exclude one another. This is the common, awkward reality of the healthcare dataset that threads through the book.
"Multivariate" sounds like more of the same, just wider. The dimensionality is the easy part. The hard part is that with $d$ channels there are up to $d(d-1)$ directed lead-lag relationships to get right, and most of them are spurious. Half the craft of multivariate forecasting is deciding which channels to let talk to each other and which to keep politely apart.
3. Event Sequences and Point Processes Intermediate
Sometimes the data is not a value sampled through time but a list of when things happened. A user clicks, a transaction settles, a neuron spikes, a machine throws a fault. The raw object is a sequence of event times in continuous time,
$$0 \le t_1 < t_2 < \dots < t_N \le T,$$optionally carrying a mark $m_i$ that labels each event (which product was bought, which fault code fired). This is a marked point process, and it is fundamentally different from a fixed-grid series: there is no value "between" events, and the quantity of interest is the rate at which events occur. That rate is captured by the conditional intensity function
$$\lambda^{*}(t) = \lim_{\delta \to 0} \frac{\mathbb{E}[\, N([t, t + \delta)) \mid \mathcal{H}_t \,]}{\delta},$$the instantaneous expected event rate given the history $\mathcal{H}_t$ of everything that happened before $t$. A Poisson process has a constant or purely time-driven $\lambda^{*}$; a self-exciting Hawkes process lets each event raise the intensity for its successors, which is why trades, earthquakes, and retweets all arrive in bursts. Contrast this with a regular series: there, time is a grid index and we model the value; here, time is the random quantity and we model its intensity. Trying to bin events into fixed windows and counting them per bin reduces a point process to a coarse regular series of counts, discarding the exact timing that intensity-based models exploit. The full treatment of point processes and neural intensity models lives in Chapter 18.
4. Spatio-Temporal Data Intermediate
Add a spatial index to a time series and you get spatio-temporal data, a value that varies over both space and time,
$$x(s, t), \qquad s \in \mathcal{S}, \; t = 1, \dots, T,$$where $\mathcal{S}$ is a set of locations, a road network's sensors, a grid of weather cells, the stations of a bike-share system, the cells of a mobility heat map. The defining feature is that nearby locations are correlated, just as nearby times are: traffic on one road segment predicts congestion on the next a few minutes later, and a storm front in one weather cell arrives in its neighbour soon after. The spatial structure is extra information, and ignoring it (flattening the locations into independent series) discards the geography that makes short-horizon forecasts accurate. The machinery that respects both axes at once, graph convolutions over the spatial layout combined with temporal models, is the subject of Chapter 32 on spatio-temporal intelligence, where the sensor and mobility datasets return in force.
The geographer's adage that "everything is related to everything else, but near things are more related than distant things" is sometimes called the first law of geography. Spatio-temporal modelling is what happens when you bolt the same intuition onto the clock: near things and recent things both leak information, and the art is borrowing strength across both at once without drowning in the product of the two index sets.
5. Static-Plus-Dynamic and Panel Data Intermediate
Real datasets rarely consist of pure dynamics. A time-varying signal usually arrives alongside static covariates, attributes that do not change over the horizon of interest, and the two must be modelled together. A retail forecast pairs each store's daily sales (dynamic) with the store's region, size, and format (static metadata); a patient's vitals (dynamic) ride alongside age, sex, and diagnosis (static). Formally each entity $j$ carries a static vector $\mathbf{z}_j$ and a dynamic series $\mathbf{x}_{j,t}$, and we model
$$\mathbf{x}_{j,t} \in \mathbb{R}^{d}, \qquad \mathbf{z}_j \in \mathbb{R}^{p}, \qquad j = 1, \dots, M,$$a structure the deep forecasting architectures of Chapter 14 handle explicitly with separate encoders for static and dynamic inputs. When many such entities are observed over the same time span, the collection is called panel or longitudinal data: thousands of stores, each a short series, sharing structure. Panels are frequently hierarchical or grouped, products nest within categories within regions, and forecasts at different levels of the hierarchy should reconcile (the products should sum to the category). This grouped structure is both a constraint to enforce and statistical strength to borrow, since a short series for a new store can lean on the behaviour of its cohort.
The payoff of the static-plus-dynamic and panel structure is statistical strength. A brand-new store has almost no history of its own, but it is not alone: it sits inside a cohort of similar stores whose static covariates (region, size, format) mark them as relatives. A panel model can pool across that cohort, letting the new store inherit a sensible seasonal shape and demand level from peers it resembles, then sharpen the estimate as its own data accrues. The short series borrows the cohort's history; the static covariates decide whom it is allowed to borrow from.
6. Stationary vs Non-Stationary, and Distribution Shift Advanced
The final axis asks whether the data-generating process holds still. A series is (weakly) stationary when its mean, variance, and autocovariance do not depend on absolute time: for all lags $k$,
$$\mathbb{E}[x_t] = \mu, \qquad \mathrm{Cov}(x_t, x_{t+k}) = \gamma(k) \quad \text{independent of } t.$$Two errors recur here. First, a unit-root test that fails to reject non-stationarity is not proof that a series is stationary; the test merely failed to find enough evidence at one sample size, and a borderline series can pass on Tuesday and fail on Friday. Second, differencing does not automatically deliver stationarity: over-differencing injects spurious negative autocorrelation and can destroy the very signal you meant to model. Differencing is a discipline, not a reflex, and the route is made precise in Chapter 5.
Stationarity is the load-bearing assumption beneath most classical theory, because it is what lets the past speak to the future at all; if the rules change every week, yesterday's fitted model describes a world that no longer exists. Most interesting series are non-stationary: they trend, they exhibit seasonality, their volatility clusters, and their underlying regime shifts (a market crash, a pandemic, a sensor that ages). The classical response is to transform a non-stationary series into a stationary one, by differencing or removing trend and seasonality, before modelling, the route taken in Chapter 5.
The same phenomenon, viewed through a machine-learning lens, is distribution shift: the joint distribution of inputs and targets at deployment time differs from the one the model trained on. This framing recurs through the entire book, because it is the central reason temporal models decay in production and the motivation for the online, continual, and adaptive methods of Chapter 20 and the conformal uncertainty methods of Chapter 19. Stationarity versus non-stationarity is thus not a niche statistical concern; it is the recurring antagonist of the whole field, and naming it now lets us track it across every later chapter.
Figure 1.4.1 contrasts three of these shapes side by side, a regular grid series, an irregular event series, and a multivariate panel, because seeing them as distinct geometric objects is the mental model the taxonomy is meant to install.
The code below makes the three core shapes concrete with pandas and NumPy, constructing a regular series, an irregular series, and a multivariate frame, so the abstractions become objects you can inspect.
import numpy as np
import pandas as pd
rng = np.random.default_rng(0)
# (1) Regular series x_t: one value per fixed tick (hourly), evenly spaced.
reg_index = pd.date_range("2026-01-01", periods=6, freq="h")
regular = pd.Series(rng.normal(size=6).round(2), index=reg_index, name="temp_c")
# (2) Irregular series {(t_i, x_i)}: clinician-chosen, uneven gaps.
event_times = pd.to_datetime([
"2026-01-01 00:14", "2026-01-01 02:47",
"2026-01-01 03:05", "2026-01-01 09:31"])
irregular = pd.Series([1.3, 2.1, 2.0, 0.7], index=event_times, name="lactate")
gaps_min = irregular.index.to_series().diff().dt.total_seconds().div(60)
# (3) Multivariate frame x_t in R^d: several coupled channels, one clock.
multivariate = pd.DataFrame({
"heart_rate": rng.normal(80, 5, 6).round(1),
"spo2": rng.normal(97, 1, 6).round(1),
"resp_rate": rng.normal(16, 2, 6).round(1),
}, index=reg_index)
print("REGULAR (fixed", regular.index.freqstr, "step):")
print(regular.to_string(), "\n")
print("IRREGULAR (gaps in minutes between draws):")
print(gaps_min.round(0).to_string(), "\n")
print("MULTIVARIATE shape (timesteps, channels):", multivariate.shape)
freqstr); the irregular series has no frequency and its inter-arrival gaps must be computed explicitly; the multivariate frame stacks coupled channels on a shared clock.REGULAR (fixed h step):
2026-01-01 00:00:00 0.13
2026-01-01 01:00:00 -0.13
2026-01-01 02:00:00 0.64
2026-01-01 03:00:00 0.36
2026-01-01 04:00:00 0.44
2026-01-01 05:00:00 0.30
IRREGULAR (gaps in minutes between draws):
2026-01-01 00:14:00 NaN
2026-01-01 02:47:00 153.0
2026-01-01 03:05:00 18.0
2026-01-01 09:31:00 386.0
MULTIVARIATE shape (timesteps, channels): (6, 3)
h (hourly); the irregular series reports gaps of 153, 18, and 386 minutes, the uneven spacing that any grid-based resampling would erase; the multivariate frame is a rectangular (6, 3) tensor of three coupled channels.The comparison table consolidates the six axes into a single reference, pairing each data type with an example domain, its mathematical notation, the challenge it poses, and the chapter that treats it. Use it as a lookup: identify your dataset's shape, then jump to the indicated chapter through the table of contents.
| Data type | Example domain | Notation | Key challenge | Treated in |
|---|---|---|---|---|
| Regular series | 1 Hz sensor, daily prices | $x_t,\; t = 1,\dots,T$ | Choosing lags and seasonality | Chapter 5 |
| Irregular series | Clinical labs, trade ticks | $\{(t_i, x_i)\}$ | Gaps are signal; no grid to model on | Chapter 13 |
| Multivariate | Coupled vitals, asset baskets | $\mathbf{x}_t \in \mathbb{R}^{d}$ | Cross-series lead-lag dependence | Chapters 6, 18 |
| Event / point process | Clicks, transactions, spikes | $\{t_i\},\; \lambda^{*}(t)$ | Modelling an intensity, not a value | Chapter 18 |
| Spatio-temporal | Traffic, weather grids, mobility | $x(s, t)$ | Correlation across space and time | Chapter 32 |
| Static + dynamic / panel | Retail by store, patients | $\mathbf{x}_{j,t},\, \mathbf{z}_j$ | Fusing context, hierarchy, grouping | Chapter 14 |
| Stationary vs not | Any series under drift | $\gamma(k)$ vs shift | Statistics that move at deployment | Chapters 19, 20 |
The table makes plain that these axes are not mutually exclusive. The healthcare dataset that recurs through this book is simultaneously irregular, multivariate, static-plus-dynamic, and non-stationary, which is exactly why it is hard and exactly why it is instructive. Classifying a dataset means locating it on all six axes at once.
The frontier is moving decisively toward methods that handle these shapes natively rather than forcing them onto a grid. Continuous-time models treat the observation times as first-class inputs: Neural Controlled Differential Equations (Kidger et al.) drive a differential equation by an interpolation of the irregular observations, so the hidden state evolves between samples and missing values need no imputation, and later work such as the closed-form continuous-time networks pushes the same idea toward efficiency. In parallel, the temporal foundation-model wave (TimesFM, Moirai, Chronos, MOMENT, Lag-Llama, 2024 to 2025) pursues a single pretrained model that ingests univariate, multivariate, and variably sampled series across domains, and multimodal extensions fold in static metadata and text. The unifying research bet is that one architecture can absorb the whole taxonomy of this section, regular and irregular, univariate and multivariate, values and events, if it is built to consume time itself rather than assuming a tidy grid. We return to these models in Chapters 13 and 15.
For each of the following, place it on all six axes of Table 1.4.1 (regular or irregular, univariate or multivariate, value or event, spatial or not, any static covariates, likely stationary or not): (a) one minute of accelerometer x, y, z from a phone; (b) the timestamps of every login to a website over a month; (c) hourly PM2.5 readings from 40 city air-quality stations; (d) a single patient's irregular blood-pressure cuff readings during a hospital stay with their age and diagnosis attached; (e) daily closing prices of one stock index across two decades. Where a dataset sits on several axes at once, say so explicitly.
Extend Code 1.4.1. Take the irregular lactate series and resample it onto a fixed 30-minute grid with both forward-fill and linear interpolation. Compare the gridded series against the original four measurements: how many of the resulting grid points are real measurements versus fabricated, and what does the forward-filled value imply about the patient during the 386-minute gap? Write two or three sentences on what information the gridding destroyed and what confound it could introduce, connecting your answer to the clinical practical-example above.
You hold the exact timestamps of 10,000 retail transactions over one day. A colleague proposes converting them to an hourly count series so a standard forecaster can be applied. Identify at least two questions answerable from the raw event sequence (with its intensity function) that the hourly counts can no longer answer, and one question the hourly counts answer perfectly well. Use this to argue when reducing a point process to a regular count series is acceptable and when it is not.