HomeProbability & StatisticsStochastic Processes

🎲 Stochastic Processes — Random Walks, Brownian & Martingales

Explore random walks, geometric Brownian motion (stock prices), and Poisson processes. See how the Central Limit Theorem makes the sum of independent random steps converge to a Gaussian.

Probability & Statistics3DModerate60 FPS
stochastic-processes ↗ Open standalone

Explore random walks, geometric Brownian motion (stock prices), and Poisson processes. See how the Central Limit Theorem makes the sum of independent random steps converge to a Gaussian distribution regardless of the step distribution.

🔁 Random Walk

A 1D random walk X_n = Σε_i where each ε_i = ±1 with equal probability. After n steps the standard deviation grows as σ = √n. The distribution of endpoints converges to N(0,n) by the Central Limit Theorem. In 2D, the walker covers area proportional to n but returns to origin infinitely often (recurrence).

📈 Geometric Brownian Motion

Stock prices follow S(t) = S₀·exp((μ−σ²/2)t + σW_t) where W_t is a Wiener process. The log-normal distribution means prices can't go negative. The Itô term −σ²/2 corrects for the non-linearity of exponentiation. 95% confidence bands grow as ±2σ√t over time.

⌛ Poisson Process

Events arrive at constant rate λ. The number of events in time t follows Poisson(λt): P(N=k) = (λt)^k e^(−λt)/k!. Inter-arrival times are exponential with mean 1/λ. Applications: radioactive decay, network packets, insurance claims. The Poisson process is the unique process with stationary independent increments.

🎮 How to Use

Switch between 1D Walk, 2D Walk, Stock Price (geometric BM), and Poisson tabs. Adjust N paths, steps, drift μ, volatility σ, and arrival rate λ. Click Regenerate to resample all paths. The histogram shows the distribution of final positions. Watch statistics update — notice variance grows linearly with steps in a random walk.

About this simulation

This simulator generates dozens of independent random paths side by side — a 1D coin-flip walk, a 2D random walk, geometric Brownian motion (the standard stock-price model), or a Poisson arrival process — and overlays the theoretical prediction on top of the raw randomness. Watch the ±√n bands bound a random walk's spread, the 95% confidence bands bracket simulated stock prices, and the live histogram of endpoints gradually take on the bell-curve shape the Central Limit Theorem guarantees, no matter how simple each individual step was.

🔬 What it shows

Many coloured sample paths plotted together with the relevant theoretical envelope overlaid — dashed ±√n bands for random walks, a dashed diffusion circle in 2D, dashed 95% confidence bands for stock prices, or an expected-rate line for Poisson arrivals — plus a live histogram (1D mode) of where paths end up.

🎮 How to use

Switch between 1D Walk, 2D Walk, Stock and Poisson tabs, adjust N paths, steps/time, drift μ, volatility σ and rate λ, and click Regenerate to resample, watching mean, variance, skewness and kurtosis update for the current process.

💡 Did you know?

A simple 1D random walk is recurrent — a walker is mathematically guaranteed to return to its starting point infinitely often — and the same holds in 2D, but not in 3D or higher, where a random walker can wander off and never come back with positive probability.

Frequently asked questions

What is the Central Limit Theorem showing here?

It states that the sum of many independent random steps converges to a Gaussian (normal) distribution regardless of the individual steps' distribution. In 1D Walk mode, watch the histogram of final positions gradually take on a bell-curve shape as you increase the number of steps.

Why do the ±√n bands widen the way they do?

For a simple random walk, the standard deviation of the walker's position after n steps grows as √n, not linearly with n — this sublinear growth is why the dashed theoretical bands curve outward more slowly than a straight line, tightly bracketing where most paths actually end up.

What is geometric Brownian motion and why use it for stock prices?

It's a model where the log of the price follows ordinary Brownian motion with drift, ensuring prices stay positive (unlike plain Brownian motion, which can go negative). The formula includes an Itô correction term −σ²/2 that accounts for the mathematical quirks of exponentiating a random process.

What is a Poisson process?

It models events (radioactive decays, network packets, customer arrivals) happening at a constant average rate λ, with the number of events in time t following a Poisson distribution and the gaps between events being exponentially distributed. It's the unique process with independent, stationary increments.

Why does the 2D random walk return to its starting point but not necessarily in 3D?

This is Pólya's recurrence theorem: a simple random walk on a 1D or 2D lattice is recurrent (guaranteed to return to the origin infinitely often), but in 3D or higher dimensions it becomes transient — there's a positive probability the walker never returns.

⚙ Under the hood

Random walks, Brownian motion, geometric Brownian motion, Poisson processes and the central limit theorem.

random walkBrownian motiongeometric BrownianPoisson processCLT

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)