📈 The Market Random Walk

Created by Dr. Pedram Jahangiry | Enhanced with Claude

Stock prices are often described as a random walk: each trading day the price moves by a small expected drift plus a surprise nobody can predict. This tool simulates exactly that model as price paths you can add one at a time, with sliders for annual drift, volatility, horizon, and the shape of the daily shocks (Gaussian, fat-tailed Student-t, a plain coin flip, or uniform). A forecast cone shows how uncertainty grows with the square root of time, the returns strip shows the noise that produces every apparent trend, and the histogram shows the spread of final prices across paths.

Interactive teaching tool: why stock prices look the way they do

log Pt = log Pt−1 + μ + εt tomorrow's price = today's price × edrift + surprise E[εt] = 0 · εt has no memory
252
≈ 1.0 year
+8%
≈ +0.032% per day
20%
≈ 1.26% per day
all shapes are scaled to the same σ
12 ms
Price paths, starting at $100
latest path earlier paths central forecast (drift only) ±1σ√t and ±2σ√t bands
Daily returns of the latest path
Hover for values · click the price chart to move the forecast origin to that day · reset to day 0
Where does the price end up?
Add paths to see the spread of final prices.

Latest path

All paths

How to read this

Each trading day the price moves by a drift μ plus a surprise ε. The surprise averages zero and has no memory: yesterday's surprise tells you nothing about today's. That one assumption produces everything on this page.

log Pt = log Pt−1 + μ + εt   ⇔   Pt = Pt−1 · eμ + εt   ⇔   daily return rt = μ + εt

The random walk lives in log prices, so returns compound and the price can never go negative. Flip on Log scale and the same path becomes the plain additive random walk with drift that you meet in every time-series course. The sliders are annual; the tool converts them to daily values: μday = μ / 252 and σday = σ / √252. At the defaults (8% and 20%) that is about +0.03% of drift against 1.26% of noise every day, so the daily surprise is roughly 40 times the daily drift. That ratio is why tomorrow looks unpredictable even when the long-run drift is real.

The sliders re-price the paths already on screen using the same random surprises. Drag drift or volatility and you can watch what each parameter does to a path without the randomness changing under you.

Why markets look like this

If today's price already reflects what is known, only new information can move it, and news is by definition not predictable from the past. Returns then behave like ε: noise with no pattern. Prices are the running sum of that noise, and running sums of noise wander, form apparent trends, and never revert to anything. Bachelier wrote this down in 1900, Samuelson and Fama turned it into the efficient-market benchmark, and Malkiel gave it its popular name. Real markets show small departures (volatility clustering, fat tails, faint short-horizon predictability), but the random walk remains the benchmark that any forecast, chart pattern, or trading rule has to beat.

Five things to try

  1. Patterns from nothing. Set drift to 0 and add 25 paths. Find the most convincing uptrend, the cleanest "support level", the scariest crash. Every one of them came from a coin with no memory. The returns strip under the chart is the honest picture: no trend, no cycle, just noise. Trends live in the price chart only because it accumulates that noise.
  2. Uncertainty grows with √t, not t. The gold cone is the ±1σ√t and ±2σ√t band around the drift line. Drag the horizon from 252 to 1008 days: four times the days, but the cone ends only about twice as wide.
  3. The best forecast is today's price, plus drift. Click any day on the chart and the cone re-anchors there. Its center is just the last price drifting slowly upward, and no amount of history narrows the band. Nothing before the last price helps. This "naive" forecast is the benchmark that any ARIMA, exponential smoothing, or machine-learning model has to beat on financial data.
  4. Drift versus noise. At 8% drift and 20% volatility, about one path in three ends the year below where it started (histogram on the right). Stretch the horizon to 5 years and it drops to about one in five: the drift accumulates with t while the noise only grows with √t, so time is on the side of the drift.
  5. Fat tails. Switch the shock to Student-t. Same volatility, but a handful of days now carry most of the action: the crash days that Gaussian noise almost never produces. Then try the coin flip, the original textbook random walk. It still looks like a stock chart.

Where this leads

A random walk is the simplest process with a unit root: it is not stationary, its variance grows without bound, and its first difference (the return) is white noise. That is why ARIMA models for prices use d = 1, why forecasting textbooks treat "tomorrow = today" as the baseline, and why so much of financial econometrics is about testing whether returns carry any structure at all. To see stationarity itself, continue with the Stationarity Visualizer.