Marginal

Stochastic Processes

Randomness unfolding in time: classifying Markov chains, stationary distributions and detailed balance, absorption and hitting times, mixing and the spectral gap, the Markov-chain ergodic theorem, hidden Markov models, Markov chain Monte Carlo, the Poisson process, continuous-time chains and queues, branching processes, random walks, Brownian motion and Itô's lemma, stochastic differential equations, the Fokker–Planck equation and Langevin sampling.

31 lessons in 3 units

Start your free trial14 days free. No card needed.
What you'll learn

31 lessons, one small step at a time

Each lesson states its goal, then works up to it in short steps with practice after each. A placement test at the start skips what you already know.

Discrete-Time Markov Chains

13 lessons
  1. Multi-step transitionsCompute multi-step transition probabilities, and evolve a distribution through a Markov chain.
  2. Classifying Markov chainsFind the period of a state, and tell transient states from recurrent ones.
  3. Two-state chainsCompute the stationary distribution of a two-state chain from its flows or from its matrix, and the expected length of a spell.
  4. Detailed balanceCheck detailed balance and use it to find stationary distributions, and recognize reversible chains.
  5. First-step analysisCompute hitting probabilities and expected hitting times by conditioning on the first step.
  6. Gambler's ruinCompute the gambler's ruin probabilities and expected durations, including against an infinite bank.
  7. Mixing & the spectral gapCompute how fast a chain approaches stationarity from its second eigenvalue, measure the distance in total variation, and find relaxation and mixing times.
  8. Long-run averagesCompute long-run time averages and mean return times of a Markov chain, and explain why one long run can stand in for an expectation.
  9. Predicting hidden statesPush beliefs about a hidden state forward through a Markov chain, and predict the next signal.
  10. Filtering hidden statesUpdate beliefs on a signal, run the forward algorithm, compute the likelihood of an observation sequence, and interpret belief states.
  11. Decoding hidden pathsCompute the probability of a hidden path, find the most likely path, tell decoding from filtering, and smooth past beliefs.
  12. Markov chain Monte CarloCompute Metropolis acceptance probabilities, including for Boltzmann targets, and tune a sampler in practice.
  13. Gibbs samplingRun Gibbs sampling steps from discrete and continuous conditional distributions, and tell when the sampler mixes slowly.

Continuous-Time Processes

9 lessons
  1. Poisson countsCompute Poisson counts and their ratios, use independent increments, and compute waiting times and their lack of memory.
  2. Superposition & thinningMerge and thin Poisson streams, and compute which of several streams fires first.
  3. Renewal processesCompute long-run renewal rates and renewal–reward averages, and explain the inspection paradox.
  4. Holding times & jumpsCompute where a continuous-time chain jumps next and how long it stays in a state.
  5. Continuous-time Markov chainsBuild a chain's generator matrix, compute long-run shares, and find how fast the chain approaches equilibrium.
  6. Little's lawApply Little's law to find times from counts and counts from times, in queues and beyond.
  7. The M/M/1 queueCompute an M/M/1 queue's average length, its average wait and the distribution of its length.
  8. Branching growthCompute the mean number of offspring, the expected size of later generations, and the chance of extinction by a given generation.
  9. Extinction probabilitiesCompute extinction probabilities from the fixed-point equation, for one ancestor and for several.

Diffusions

9 lessons
  1. Brownian scalingCompute probabilities for standard Brownian motion, and its square-root spread over time.
  2. Brownian motion with driftCompute the distribution of Brownian motion with drift at a future date, and compare drift with noise over different horizons.
  3. Itô's lemmaApply Itô's lemma to find the drift of a function of a diffusion, and compute volatility drag.
  4. Lognormal pricesCompute the mean and median of a lognormal price, and the probability that it ends above a level.
  5. Random walks & recurrenceCompute the probability that a random walk is back at its start, how far it spreads, and in which dimensions it surely returns.
  6. Simulating SDEsTake Euler–Maruyama steps of a stochastic differential equation, scale its noise correctly, and check the scheme against geometric Brownian motion.
  7. The Ornstein–Uhlenbeck processCompute the expected path of an Ornstein–Uhlenbeck process, its AR(1) form when sampled, its half-life and its stationary spread.
  8. The Fokker–Planck equationCompute the stationary densities of diffusions in a potential, read noise as temperature, and describe the flow of probability.
  9. Langevin dynamics & samplingTake Langevin sampling steps, balance the gradient against the noise, and explain the method's use in Bayesian learning.
Sample lesson

Multi-step transitions

Goal: Compute multi-step transition probabilities, and evolve a distribution through a Markov chain.

In 1913 Andrey Markov counted vowels and consonants in Pushkin's Eugene Onegin to show that dependent events still obey laws of large numbers. His chains, where the next state depends only on the current one, now model weather, credit ratings, web surfing and language.

We will look two steps ahead and finish with evolving distributions.

Step 1: Two steps ahead

One-step probabilities Pᵢⱼ = P(Xt+1 = j | Xₜ = i) determine everything else. The probability of a particular path multiplies its steps: in a chain that stays in state 2 with probability 0.6, the path 2 → 2 → 2 has probability 0.36. Two-step probabilities add the paths over the intermediate state:

P(X₂ = j | X₀ = i) = Σₖ PᵢₖPₖⱼ = (P²)ᵢⱼ

If state 1 stays with probability 0.8 and moves to 2 with 0.2, while state 2 returns to 1 with 0.4, then P(1 → 1 in two steps) = 0.8 × 0.8 + 0.2 × 0.4 = 0.72.

Step 2: Evolving distributions

If today's state is uncertain, with distribution μ written as a row vector, tomorrow's is

μt+1 = μₜP, and after n steps μₙ = μ₀Pⁿ

In the example, starting from μ₀ = (0.5, 0.5), tomorrow's distribution is (0.5 × 0.8 + 0.5 × 0.4, 0.5 × 0.2 + 0.5 × 0.6) = (0.6, 0.4). A state can be reached in exactly n steps only if some path of n arrows, each with positive probability, leads there: in a chain 1 → 2 → 3 → 1, from state 1 only state 3 can be reached in exactly 2 steps.

In the app, each step ends with practice questions, new ones every time, and the lesson comes back later in spaced reviews.

Start Stochastic Processes

Lessons that need something you haven't learned yet bring it in first, from any course.

Start your free trial14 days free. No card needed.