Objective
Model things that change at random times rather than at fixed steps: order arrivals, defaults, regime switches, a spread that keeps being pulled back to its mean. The organising idea is the Markov property in continuous time: the future depends on the present state only, not on how long you have been in it. For jump processes that forces waiting times to be exponential.
The exponential and memorylessness
has , mean , and
Having waited tells you nothing about the remaining wait. The exponential is the only continuous distribution with this property, which is why it appears whenever a process "forgets" its history. Two facts used constantly: for independent , and .
The Poisson process
A Poisson process with rate counts events such that:
- , and counts over disjoint intervals are independent.
- .
Equivalently, the gaps between events are i.i.d. . The two descriptions are linked by , and the time of the -th event is Gamma.
Operations that keep you inside the family:
- Superposition. Independent Poisson processes with rates and merge into a Poisson process of rate , and each event independently comes from the first with probability .
- Thinning. Keep each event independently with probability . The kept events form a Poisson process of rate , the discarded ones a Poisson process of rate , and the two are independent.
- Conditional uniformity. Given , the event times are distributed as i.i.d. Uniform points, sorted. The rate drops out.
Worked example
buy and sell orders
Buy orders arrive as a Poisson process at 3 per minute and sell orders independently at 2 per minute. 10% of buy orders are large, independently of everything else.
- What is the probability the next order is a buy, and the expected time until it?
- What is the probability at least two buys arrive before the first sell?
- What is the probability of no orders at all in the next 30 seconds?
- What is the probability of no large buy in the next 10 minutes?
Show solutionHide solution
- All orders form a Poisson process of rate per minute. The next one is a buy with probability , and it arrives after an wait with mean minute seconds.
- Each order is independently a buy with probability , so we need the first two orders to be buys: .
- , so .
- By thinning, large buys form a Poisson process of rate per minute. Over 10 minutes the count is Poisson, so the probability is .
Each step reduced to a single fact (superposition, competing exponentials, the Poisson count, thinning). Name the fact out loud before computing.
Continuous-time Markov chains
A continuous-time Markov chain (CTMC) on a finite state space is specified by a generator (rate) matrix :
- for is the rate of jumping from to ;
- the diagonal is with , so every row sums to zero.
The dynamics, read straight from :
- Holding time. In state the chain waits an time, as the minimum of competing exponential clocks of rates .
- Jump. It then moves to with probability . These probabilities form the embedded jump chain, a discrete-time Markov chain.
- Transition probabilities. satisfies (the forward equation), so . Over a short interval, .
A stationary distribution solves with . Row by row this is global balance: the rate of probability flowing out of state , , equals the rate flowing in, . For an irreducible finite chain is unique, rows of , and is the long-run fraction of time in . There is no periodicity problem in continuous time.
For two states with rates () and (),
so the chain forgets its start at rate , the non-zero eigenvalue of .
Jump chain versus time. The stationary distribution of the jump chain counts visits, not time. Time fractions weight visits by mean holding times: . A state visited often but left quickly can hold little of the time.
Worked example
a three-regime market
A market moves between Calm (C), Stressed (S) and Crisis (K), with rates per year
(rows and columns ordered C, S, K). Find the long-run fraction of time in each regime, the expected time to the first crisis starting from Calm, and check your answer against the jump chain.
Show solutionHide solution
Stationary distribution. The columns of give
- S: , so ;
- K: , so .
Normalising, , so . The C column checks: .
Flow check. Crises start at long-run rate per year and last year on average, so the time fraction in crisis is . Consistent.
Time to crisis. Let be the expected time to reach K from . Each equation is "mean holding time plus where you go next":
Substituting, , so years (and ).
Jump chain. Its transition probabilities are C S with probability 1, S C with and S K with , K C with 1. Its stationary distribution is : Calm and Stressed are visited equally often. Weighting by mean holding times gives , which normalises to again. Stressed spells are as frequent as calm ones but much shorter.
Simulating a CTMC
The holding-time and jump description is also the simulation algorithm (often called Gillespie's algorithm): draw an exponential holding time with the total exit rate, then pick the destination in proportion to its rate.
import random
rates = {"C": {"S": 2.0}, "S": {"C": 4.0, "K": 1.0}, "K": {"C": 3.0}}
def time_fractions(start="C", horizon=100_000.0, seed=1):
rng = random.Random(seed)
state, t = start, 0.0
occupied = {s: 0.0 for s in rates}
while t < horizon:
out = rates[state]
total = sum(out.values())
hold = min(rng.expovariate(total), horizon - t) # Exp(total) holding time
occupied[state] += hold
t += hold
u, acc = rng.random() * total, 0.0 # jump to j with prob q_ij / q_i
for nxt, q in out.items():
acc += q
if u < acc:
state = nxt
break
return {s: round(v / horizon, 3) for s, v in occupied.items()}
print(time_fractions()) # {'C': 0.651, 'S': 0.262, 'K': 0.087}
The simulated fractions match to within Monte Carlo error.
A continuous-state example: Ornstein–Uhlenbeck
Not every Markov process jumps. The Ornstein–Uhlenbeck (OU) process moves continuously and is pulled towards a level :
Intuitively, over a short step the process drifts back towards at a speed proportional to its distance from it, and receives a Brownian shock. It is Markov (the next move depends only on the current value) and Gaussian, with
- The expected gap from decays exponentially, with half-life .
- As the law settles to the stationary distribution : reversion strength and noise balance.
- Sampled every , it is exactly an AR(1): with and . Fitting an AR(1) to daily data and reading off is how you estimate in practice.
OU is the standard toy model for pairs-trading spreads, short rates (Vasicek) and the log of volatility. Its weaknesses: it can go negative, the reversion speed is assumed constant, and estimates of from short samples are noisy and biased towards faster reversion.
Worked example
a mean-reverting spread
A spread follows an OU process with , half-life 5 trading days and per square-root day. It is currently at 4. Find its stationary standard deviation, its distribution in 5 days, and the probability it is below zero then.
Show solutionHide solution
Reversion speed. per day.
Stationary spread. , so the stationary standard deviation is about . A reading of 4 is about stationary standard deviations out.
In 5 days. The mean halves: . The variance is , a standard deviation of about .
Crossing zero. .
So even with a 5-day half-life, the spread has only about an 11% chance of having crossed back through its mean in 5 days: the expected gap halves, but the noise accumulated over 5 days is comparable to the remaining gap. The daily AR(1) coefficient is .
Knowledge check
Buses arrive as a Poisson process at 4 per hour. You have already waited 20 minutes. What is your expected additional wait?
Knowledge check
A Poisson process of rate has exactly 3 events in . What is the probability that all three occurred in ?
Knowledge check
A two-state CTMC's jump chain simply alternates, so it visits each state equally often. The holding rate is 1 in state A and 3 in state B. What long-run fraction of time is spent in A?
Knowledge check
An OU process has reversion speed per day. What is the half-life of a deviation from the mean?
Key takeaways
- Continuous-time jump processes that forget their past have exponential holding times; competing exponentials give the minimum rate and winner probabilities .
- Poisson processes are closed under superposition and thinning, and given the count, event times are uniform.
- A CTMC is a generator with rows summing to zero: hold , jump with probabilities , .
- Stationary distributions solve and give time fractions; jump-chain frequencies must be weighted by mean holding times.
- Expected hitting times solve "holding time plus expected time from the next state" equations.
- The OU process is the continuous-state, mean-reverting Gaussian Markov process: half-life , stationary variance , and an AR(1) when sampled discretely.
Practice problems
Finished reading?
Answer the 4 knowledge checks to complete this lesson (0 done).