1. Home
  2. Explore
  3. Statistics
  4. Stochastic Processes: Basics

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Stochastic Processes: Basics

Stochastic Processes, Martingales, and Markov Chains

A stochastic process is a way to describe a collection of random quantities that may be related to one another. When those quantities represent a system changing over time, two especially important ideas are martingales, which describe fair average changes, and Markov chains, which describe systems whose predictions depend on the present rather than the full past.

These ideas are related, but neither one implies the other. A process can be both, either one, or neither. Understanding why requires first being clear about what a stochastic process is and what information is available at each time.

What Is a Stochastic Process?

A stochastic process is a collection of random variables defined on the same probability space. In general, it can be written as

(Xi)i∈I,(X_i)_{i\in I},(Xi​)i∈I​,

where each random variable takes values in a state space SSS. The index set III can be finite, countably infinite, or uncountable. It can also have more than one dimension.

The random variables all share one probability space, usually written as (Ω,F,P)(\Omega,\mathcal F,\mathbb P)(Ω,F,P). This common space matters: it allows the variables in the process to describe different aspects or stages of the same random experiment.

Realizations, sample paths, and state spaces

The set Ω\OmegaΩ contains the possible outcomes of the underlying experiment. In the language of stochastic processes, an individual outcome ω∈Ω\omega\in\Omegaω∈Ω is often called a realization.

The state space SSS is the set of values the process can take. For example, a process tracking a particle’s position on the integers has state space Z\mathbb ZZ, while a process recording whether a coin flip is heads or tails could use the state space {−1,+1}\{-1,+1\}{−1,+1}.

The process itself is the whole collection of random variables. But if one particular realization ω\omegaω is fixed, then each random variable can be evaluated at that outcome:

i⟼Xi(ω).i\longmapsto X_i(\omega).i⟼Xi​(ω).

The resulting sequence or collection of values is called a sample path. A realization is an outcome in the underlying probability space; its sample path is the trajectory that the process produces for that outcome. These terms are closely connected, but they refer to different things.

This distinction is useful when interpreting computer simulations. A program does not display the abstract stochastic process itself. It displays sample paths generated by the process. Simulating many times produces many sample paths, which can reveal typical behavior, but each individual output is only one realization.

For a state space with a suitable topology, its Borel sigma-algebra is the sigma-algebra generated by its open sets. When the state space is a finite or countable subset of the real line, every subset of the state space is a Borel set.

Processes that do and do not evolve in time

An index set is often used to represent time, but not every stochastic process has a temporal interpretation. A random graph, for instance, can be a static random object described by a collection of random variables. It is still a stochastic process in the general mathematical sense, even if it does not evolve through time.

For time to have a meaningful past, present, and future, the indices need an order. In the most common settings, time is either discrete or continuous:

  • In discrete time, the process is written (Xn)n≥0(X_n)_{n\geq 0}(Xn​)n≥0​, where nnn takes nonnegative integer values.
  • In continuous time, it is written (Xt)t≥0(X_t)_{t\geq 0}(Xt​)t≥0​, where ttt can be any nonnegative real number.

The basic ideas of martingales and Markov processes also have continuous-time versions. The discrete-time case is often easier to introduce because each new step has a clear predecessor.

A stochastic process is the full family of random variables; a sample path is the sequence of values produced by one realization.

Think About It

If a simulation displays one trajectory of a random walk, is that the entire stochastic process or one sample path from it?

Information and Filtrations

To define martingales and Markov chains, it is essential to describe what is known at each time. In a time-indexed process, earlier observations are in the past, the current state is the present, and later states are not yet known.

A filtration is a nondecreasing sequence of sigma-algebras,

(Gn)n≥0,Gn⊆Gn+1⊆F.(\mathcal G_n)_{n\geq 0}, \qquad \mathcal G_n\subseteq \mathcal G_{n+1}\subseteq\mathcal F.(Gn​)n≥0​,Gn​⊆Gn+1​⊆F.

A sigma-algebra represents a collection of events that can be distinguished using the available information. The filtration is therefore a mathematical model of how information accumulates over time. The sigma-algebra Gn\mathcal G_nGn​ represents the information available at time nnn: what has been learned up to and including that time. Because knowledge accumulates, Gn+1\mathcal G_{n+1}Gn+1​ contains at least as much information as Gn\mathcal G_nGn​.

Adapted processes and natural filtrations

A process (Xn)(X_n)(Xn​) is adapted to a filtration (Gn)(\mathcal G_n)(Gn​) if each XnX_nXn​ is measurable with respect to Gn\mathcal G_nGn​. Informally, this means that the state XnX_nXn​ can be known using the information available at time nnn. If the process represents the observed history of a system, its current state must be part of what is known by that time.

The natural filtration of (Xn)(X_n)(Xn​) is the information generated by observing that process:

Fn=σ(X0,X1,…,Xn).\mathcal F_n=\sigma(X_0,X_1,\ldots,X_n).Fn​=σ(X0​,X1​,…,Xn​).

It contains exactly the information available from the process’s observations from time 000 through time nnn. Since XnX_nXn​ is included in this list, the process is adapted to its natural filtration. The natural filtration is often the default choice when no other filtration is specified.

A larger filtration could include additional information from outside the process. For example, it could record observations of another system. When a statement is made about a process without naming a filtration, the natural filtration is commonly intended.

Think About It

If the information available at time nnn includes the entire observed history, why must the information available at time n+1n+1n+1 include that history too?

Martingales: Fairness in Conditional Expectation

A discrete-time process (Xn)(X_n)(Xn​) is a martingale with respect to a filtration (Gn)(\mathcal G_n)(Gn​) when, for every nnn:

  1. XnX_nXn​ is integrable, meaning E[∣Xn∣]<∞\mathbb E[|X_n|]<\inftyE[∣Xn​∣]<∞.
  2. The process is adapted to (Gn)(\mathcal G_n)(Gn​).
  3. Its next-step conditional expectation equals its current value:
E[Xn+1∣Gn]=Xn.\mathbb E[X_{n+1}\mid\mathcal G_n]=X_n.E[Xn+1​∣Gn​]=Xn​.

The first two conditions ensure that the expected value is well-defined and that XnX_nXn​ is known at time nnn. The third condition captures the central idea: given everything known so far, the expected value of the next state is the current state.

A useful intuition is a fair game. Suppose XnX_nXn​ represents a gambler’s fortune after nnn rounds. A fair game does not mean the fortune stays fixed, or that every outcome is equally likely. It means that, conditional on the gambler’s complete history, the expected fortune after one more round is the current fortune. The next change has conditional mean zero.

A martingale does not have to describe gambling. The fair-game picture is an intuition for its defining mathematical property: there is no expected upward or downward drift once the available information is taken into account.

Submartingales and supermartingales

A submartingale satisfies the same integrability and adaptedness conditions, but its conditional expectation can increase:

E[Xn+1∣Gn]≥Xn.\mathbb E[X_{n+1}\mid\mathcal G_n]\geq X_n.E[Xn+1​∣Gn​]≥Xn​.

It represents a process whose next value is, on average, at least as large as its current value, given the present information.

A supermartingale satisfies

E[Xn+1∣Gn]≤Xn.\mathbb E[X_{n+1}\mid\mathcal G_n]\leq X_n.E[Xn+1​∣Gn​]≤Xn​.

Its next value is, on average, no greater than its current value. In the gambling analogy, these correspond respectively to a favorable game and an unfavorable game.

The terms are also related to subharmonic and superharmonic functions, but the conditional-expectation inequalities give the direct meaning needed here.

A useful consequence—and a failed converse

For an integrable martingale, the law of total expectation implies that its ordinary expected value is constant over time:

E[Xn+1]=E[Xn].\mathbb E[X_{n+1}]=\mathbb E[X_n].E[Xn+1​]=E[Xn​].

This follows by taking expectations of the martingale condition. However, the reverse implication is false: a process may have constant expected value at every time and still fail to be a martingale. The martingale condition is stronger because it requires the expected next value to equal the current value after conditioning on the information available so far.

Think About It

Why is knowing that E[Xn]\mathbb E[X_n]E[Xn​] is constant weaker than knowing that E[Xn+1∣Gn]=Xn\mathbb E[X_{n+1}\mid\mathcal G_n]=X_nE[Xn+1​∣Gn​]=Xn​?

Markov Chains: The Present Is Enough

A discrete-time Markov chain is a process with a finite or countable state space whose future transition probabilities depend on the past only through the current state.

Using the natural filtration (Fn)(\mathcal F_n)(Fn​), the defining condition is that for every subset BBB of the state space,

P(Xn+1∈B∣Fn)=P(Xn+1∈B∣Xn).\mathbb P(X_{n+1}\in B\mid\mathcal F_n) = \mathbb P(X_{n+1}\in B\mid X_n).P(Xn+1​∈B∣Fn​)=P(Xn+1​∈B∣Xn​).

The event Xn+1∈BX_{n+1}\in BXn+1​∈B describes a general possible event at the next time. The equality says that knowing the entire history through time nnn gives no additional information about this event beyond knowing XnX_nXn​.

This is the Markov property, often described as memorylessness. The process does not necessarily have no history in a literal sense; rather, for predicting the next state, the history is summarized completely by the current state. Equivalently, given the present state, the past and the future are conditionally independent.

A process can be Markov without being a martingale. The Markov condition is about what information is needed to predict the future. The martingale condition is about the conditional average of the next value. Those are different questions.

Think About It

Two processes might both have a predictable next-step distribution. What additional feature would determine whether either one is also a martingale?

Four Examples

The following examples show all four possible combinations: a process may be both a martingale and a Markov chain, either one alone, or neither. The calculations rely on two basic facts about conditional expectation and probability:

  • If a random variable is already measurable with respect to the information being conditioned on, it can be treated as known.
  • If a random variable is independent of that information, conditioning on the information does not change its distribution or expectation.

1. Independent fair coin flips: Markov, but not a martingale

Let (Wn)(W_n)(Wn​) record independent fair coin flips, using

Wn={+1,for heads,−1,for tails.W_n= \begin{cases} +1,&\text{for heads},\\ -1,&\text{for tails}. \end{cases}Wn​={+1,−1,​for heads,for tails.​

Each value is equally likely, so E[Wn]=0\mathbb E[W_n]=0E[Wn​]=0. Let Fn=σ(W1,…,Wn)\mathcal F_n=\sigma(W_1,\ldots,W_n)Fn​=σ(W1​,…,Wn​). Since the next flip is independent of all earlier flips,

E[Wn+1∣Fn]=E[Wn+1]=0.\mathbb E[W_{n+1}\mid\mathcal F_n] = \mathbb E[W_{n+1}] = 0.E[Wn+1​∣Fn​]=E[Wn+1​]=0.

But WnW_nWn​ is always either +1+1+1 or −1-1−1, never 000. Therefore this conditional expectation is not equal to WnW_nWn​. It is not a martingale. It is also neither a submartingale nor a supermartingale: the value 000 is sometimes below WnW_nWn​ and sometimes above it.

The process is nevertheless a Markov chain. Independence means that the probability of the next flip is unchanged by the history. It is also unchanged by knowing the current flip, so the Markov condition holds. This is a particularly simple, or degenerate, Markov case: the next state does not depend on the present either.

This example also shows why constant expected value does not imply the martingale property. Every WnW_nWn​ has expected value zero, yet the process is not a martingale.

2. Symmetric random walk: both a martingale and a Markov chain

Now use the coin flips as increments of a particle’s position. Starting from a position X0X_0X0​, define

Xn=X0+∑k=1nWk.X_n=X_0+\sum_{k=1}^{n}W_k.Xn​=X0​+k=1∑n​Wk​.

At each step, the particle moves one unit to the right or left with equal probability. Thus

Xn+1=Xn+Wn+1.X_{n+1}=X_n+W_{n+1}.Xn+1​=Xn​+Wn+1​.

The current position XnX_nXn​ is known from the history through time nnn, while Wn+1W_{n+1}Wn+1​ is an independent fair increment. Therefore,

E[Xn+1∣Fn]=E[Xn+Wn+1∣Fn]=Xn+0=Xn.\mathbb E[X_{n+1}\mid\mathcal F_n] = \mathbb E[X_n+W_{n+1}\mid\mathcal F_n] = X_n+0 = X_n.E[Xn+1​∣Fn​]=E[Xn​+Wn+1​∣Fn​]=Xn​+0=Xn​.

So the random walk is a martingale. The fair-game interpretation is direct: moving right gains one unit, moving left loses one, and both are equally likely.

It is also a Markov chain. From any current position xxx, the next position is x+1x+1x+1 or x−1x-1x−1, each with probability 12\frac1221​. The earlier route to xxx does not affect those probabilities. In particular,

P(Xn+1=x∣Fn)=12 1{∣Xn−x∣=1},\mathbb P(X_{n+1}=x\mid\mathcal F_n) = \frac12\,\mathbf 1_{\{|X_n-x|=1\}},P(Xn+1​=x∣Fn​)=21​1{∣Xn​−x∣=1}​,

where 1A\mathbf 1_A1A​ equals 111 when event AAA occurs and 000 otherwise. The right-hand side depends on the history only through the current position XnX_nXn​, which is the Markov property.

This example demonstrates that the martingale and Markov properties can hold together.

3. Betting random walk: a martingale that can fail to be Markov

Consider a gambler whose fortune after round nnn is YnY_nYn​. The gambler bets an amount BnB_nBn​ on round nnn, and the game uses the fair-coin increment WnW_nWn​. A win adds the bet; a loss subtracts it:

Yn=Y0+∑k=1nBkWk.Y_n=Y_0+\sum_{k=1}^{n}B_kW_k.Yn​=Y0​+k=1∑n​Bk​Wk​.

The bet must be chosen before the corresponding coin flip is known. Mathematically, this is represented by requiring BnB_nBn​ to be measurable with respect to the information available before round nnn, such as Fn−1\mathcal F_{n-1}Fn−1​. This prevents the bet from being chosen after seeing whether the round was won or lost.

Assuming the bets and resulting fortunes are integrable, the next fortune is

Yn+1=Yn+Bn+1Wn+1.Y_{n+1}=Y_n+B_{n+1}W_{n+1}.Yn+1​=Yn​+Bn+1​Wn+1​.

At time nnn, both YnY_nYn​ and the already chosen bet Bn+1B_{n+1}Bn+1​ are known. The next fair-coin outcome Wn+1W_{n+1}Wn+1​ is independent of the past and has mean zero. Hence

E[Yn+1∣Fn]=Yn+Bn+1E[Wn+1]=Yn.\mathbb E[Y_{n+1}\mid\mathcal F_n] = Y_n+B_{n+1}\mathbb E[W_{n+1}] = Y_n.E[Yn+1​∣Fn​]=Yn​+Bn+1​E[Wn+1​]=Yn​.

So the fortune is a martingale. A strategy may change the size of the bet using past information, but if the game remains fair and the bet is placed before the outcome, that strategy does not create a positive conditional expected gain.

Whether this process is Markov depends on how the bets are chosen. If the bets are fixed in advance, the distribution of the next fortune is determined by the current fortune and the known bet for that time. The process then has the Markov property, though its transition probabilities may vary with time.

A history-dependent betting rule can instead make the next-step distribution depend on more than the present fortune. For example, choose two positive amounts a>ba>ba>b and bet aaa after a win, but bbb after a loss. The next bet then depends on the previous result. In terms of the fortune, the rule can be written as

Bn+1={a,Yn>Yn−1,b,Yn<Yn−1.B_{n+1}= \begin{cases} a,&Y_n>Y_{n-1},\\ b,&Y_n<Y_{n-1}. \end{cases}Bn+1​={a,b,​Yn​>Yn−1​,Yn​<Yn−1​.​

For instance, the chance of gaining exactly aaa on the next round is

P(Yn+1=Yn+a∣Fn)=12 1{Yn>Yn−1}.\mathbb P(Y_{n+1}=Y_n+a\mid\mathcal F_n) = \frac12\,\mathbf 1_{\{Y_n>Y_{n-1}\}}.P(Yn+1​=Yn​+a∣Fn​)=21​1{Yn​>Yn−1​}​.

The next-step probability depends on whether the previous round was won, information represented by Yn−1Y_{n-1}Yn−1​ as well as YnY_nYn​. When histories reaching the same current fortune can have different previous outcomes, they give different next-step probabilities. The current fortune alone then does not determine the transition probabilities, so the process is not Markov.

This example shows that a martingale need not be Markov: fair conditional average changes do not prevent the transition rule from retaining information about the past.

4. A two-coin process: neither a martingale nor a Markov chain

Now consider a process (Zn)(Z_n)(Zn​) that again takes values +1+1+1 and −1-1−1, but whose coin for the next flip depends on the previous two outcomes. Coin 111 lands heads with probability 13\frac1331​; coin 222 lands heads with probability 23\frac2332​. If the previous two results match, coin 111 is used next. If they differ, coin 222 is used. The first two flips can be set to use coin 111 to establish the initial condition.

When the previous outcomes match, the next value has mean

(+1)13+(−1)23=−13.(+1)\frac13+(-1)\frac23=-\frac13.(+1)31​+(−1)32​=−31​.

When they differ, it has mean

(+1)23+(−1)13=13.(+1)\frac23+(-1)\frac13=\frac13.(+1)32​+(−1)31​=31​.

Thus, with respect to the information Fn\mathcal F_nFn​ from the process’s history,

E[Zn+1∣Fn]=−13 1{Zn=Zn−1}+13 1{Zn≠Zn−1}.\mathbb E[Z_{n+1}\mid\mathcal F_n] = -\frac13\,\mathbf 1_{\{Z_n=Z_{n-1}\}} +\frac13\,\mathbf 1_{\{Z_n\ne Z_{n-1}\}}.E[Zn+1​∣Fn​]=−31​1{Zn​=Zn−1​}​+31​1{Zn​=Zn−1​}​.

The conditional expectation is always either −13-\frac13−31​ or 13\frac1331​, whereas ZnZ_nZn​ is always either −1-1−1 or +1+1+1. It cannot equal ZnZ_nZn​, so the process is not a martingale. It is also neither a submartingale nor a supermartingale. When Zn=−1Z_n=-1Zn​=−1, the conditional expectation is greater than ZnZ_nZn​; when Zn=+1Z_n=+1Zn​=+1, it is less than ZnZ_nZn​. Neither required inequality holds in every state.

The process is not Markov either. Its next-flip probability is

P(Zn+1=+1∣Fn)=13 1{Zn=Zn−1}+23 1{Zn≠Zn−1}.\mathbb P(Z_{n+1}=+1\mid\mathcal F_n) = \frac13\,\mathbf 1_{\{Z_n=Z_{n-1}\}} +\frac23\,\mathbf 1_{\{Z_n\ne Z_{n-1}\}}.P(Zn+1​=+1∣Fn​)=31​1{Zn​=Zn−1​}​+32​1{Zn​=Zn−1​}​.

For a fixed current value ZnZ_nZn​, this probability changes according to the previous value Zn−1Z_{n-1}Zn−1​. For example, if Zn=+1Z_n=+1Zn​=+1, then the probability of another +1+1+1 is 13\frac1331​ when Zn−1=+1Z_{n-1}=+1Zn−1​=+1, but 23\frac2332​ when Zn−1=−1Z_{n-1}=-1Zn−1​=−1. The present state alone is therefore insufficient to determine the next-step distribution.

This example is neither a martingale nor a Markov chain: the conditional mean is not the current state, and the future transition rule depends on more than the current state.

Comparing the four cases

ProcessMartingale?Markov chain?Main reason
Independent fair coin flipsNoYesThe next flip is independent, but its conditional mean is 000, not the current value.
Symmetric random walkYesYesIts next increment has mean 000, and its next-step distribution depends only on its position.
Betting random walk with a history-dependent betYesNot necessarilyA fair, predictable bet preserves the conditional mean, but the bet can retain information about earlier outcomes.
Two-coin processNoNoIts next-step mean and transition probabilities depend on the previous outcomes.

Think About It

Which property is being tested when a conditional expectation is compared with the current value, and which property is being tested when a conditional probability is compared with one conditioned only on the current state?

How These Ideas Connect to Broader Topics

Martingales are useful beyond gambling because their defining condition controls conditional averages over time. Further martingale theory includes results such as the optional stopping theorem, the upcrossing inequality, and the martingale convergence theorem. Together with related ideas such as reverse martingales, these results help explain when martingales converge and how they behave at stopping times. Martingale methods also contribute to proofs of laws of large numbers, including settings where random variables may have infinite variance.

One application is the Galton–Watson branching process, a model in which individuals produce offspring and the population changes from one generation to the next. It is used to study population dynamics in biology and can also represent broader models of spreading or invasion. Martingale results help analyze its long-term behavior.

Markov-chain theory develops the consequences of memorylessness. Important concepts include recurrence, when a process returns to a state; transience, when it may eventually leave a state without returning; irreducibility, when states communicate through possible transitions; positive recurrence, a form of recurrence with finite expected return time; aperiodicity, which rules out rigid cycles in return times; and stationary distributions, which remain unchanged under the transition rule. These ideas support convergence results for discrete-time Markov chains.

Random walks can also be studied on general connected graphs, not only on the integer line. Their behavior is related to recurrence and transience, and some random-walk questions can be connected to electrical networks in physics.

For processes that count random events over continuous time, Poisson processes provide a central model. Their important properties include superposition, which combines independent processes; thinning, which retains selected events according to a random rule; and conditioning, which describes event locations or counts once some information is known.

Under suitable conditions, a continuous-time Markov chain can be viewed as two ingredients working together: a discrete-time Markov chain describes the sequence of states visited, while Poisson processes describe the times at which jumps occur.

Review: What to Keep in Mind

A stochastic process is a family of random variables on one probability space. A realization selects one outcome, and that outcome produces a sample path. When the index represents time, a filtration describes how information accumulates, and adaptedness means the current state is known using the information available at that time.

A martingale is integrable, adapted, and has no conditional expected change from one step to the next. A submartingale has nonnegative conditional expected change; a supermartingale has nonpositive conditional expected change. These conditions concern conditional averages, not merely unconditional averages.

A Markov chain has a different defining feature: given the current state, the past adds no information about the next state. Its condition concerns conditional probabilities, not whether the expected next value equals the current one.

The four examples make the distinction concrete. Independent fair coin flips are Markov but not martingales. A symmetric random walk is both. A fair betting process can be a martingale yet fail to be Markov when its betting rule depends on earlier outcomes. A process that selects different biased coins using the previous two flips can be neither. The two properties describe different features of a stochastic process, so each must be checked separately.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent