liveBook · Manning

Random walk

As explained in Grokking Bayes

A random walk is a stochastic process in which successive states change through random increments.

A random walk models a changing quantity by assuming that each new state stays near the current state, with every change coming from random noise. For example, a latent CO₂ level can evolve as xᵢ₊₁ = xᵢ + ε, where ε follows a zero-mean Gaussian distribution. The expected next state therefore equals the current state, while σ² controls how widely the next state may vary. section 9.6

The variance expresses how quickly large changes become unlikely. A small transition variance makes the model conservative; a larger value lets it adapt more readily to observations. In a Bayesian filter, the posterior combines the random-walk prediction with noisy measurements, producing an estimate between the prior prediction and the observed data. section 9.10 section 9.9

Tracking atmospheric CO₂

To estimate the transition variance from observed CO₂ measurements, calculate successive differences and use their empirical variance: load the data with NumPy, compute np.diff(y), and calculate np.var(diffs). A random-walk Kalman filter can then update its estimate as each yearly observation arrives. section 9.6 section 9.9

Random walks are useful when the state may drift but no specific trend mechanism is supplied. They do not actively model systematic long-term movement. Consequently, multi-step forecasts have a flat predictive mean, while uncertainty grows as transition noise accumulates. section 9.15 section 9.11

𝑥ᵢ₊₁ = 𝑥ᵢ+ ε,

Use the transition equation to connect the intuitive idea of carrying the current state forward with zero-mean random change. section 9.6

How Grokking Bayes covers it

How deep it goes
Defines the Gaussian transition, variance control, filtering behavior, and forecast limitation, but stops short of explicit trend modeling.
Examples
Uses atmospheric CO₂ levels, successive differences, NumPy variance estimation, Kalman updates, and multiyear forecast plots.
What it assumes
Assumes Gaussian distributions and Bayesian filtering basics while introducing state transitions, process noise, and empirical variance selection.
What you can do after
Apply it via a Kalman filter to estimate a noisy evolving state and assess how transition variance affects adaptation and forecasts.
How it connects
Connects random walks to state-space models, Kalman filters, Gaussian distributions, empirical Bayes, and linear trend models.

Also explained in

Compare how 4 books explain random walk →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Grokking Bayes. The section links point to the parts of the book it draws on.