TL;DR
An ordinary differential equation says how a quantity changes given its current value. A stochastic differential equation (SDE) adds noise: the quantity moves by a predictable part, the drift, plus a random kick whose size depends on where it is, the diffusion. Solving an SDE means finding a random path that obeys this rule, and each run of the noise gives a different path.
SDEs are the standard model for anything that is pushed around by many small random shocks while also following a trend: a stock price, a particle in a fluid, a noisy control signal.
Where you'll see it: Black-Scholes option pricing, the forward noising process of diffusion models, and stochastic gradient Langevin dynamics for sampling from posterior distributions.
Intuition
A rule plus a coin toss at every instant
Picture a boat on a choppy lake. The wind gives it a steady push in one direction. The waves shove it sideways in a way you cannot predict exactly, but you can describe the typical size of the shove. The boat's motion over a short time is therefore the steady push times the time elapsed, plus a random shove whose spread grows with the square root of the time elapsed.
That square root is the key difference from ordinary calculus. A ball rolling for a tenth of a second moves about a tenth of its speed. A Brownian particle over the same tenth of a second moves a distance of about the square root of a tenth, roughly 0.32, which is much larger than the tenth. Random shoves add up as square roots, not as straight lines. The rules for handling that are Itô calculus, and an SDE is the object that calculus is built to solve.
Here is the picture for a noisy decay. The mean path falls exponentially, and a band of one standard deviation around it opens up over time and then levels off. Each sample path wanders inside that band.
- mean
- +1 sd
- -1 sd
Why the noise is written as dW
The noise term is written , where is a Brownian motion. You can read as "a Gaussian increment with mean zero and variance ". Its size is , which is why the square root appears. Writing the noise this way, instead of as a generic random number, makes the equation mean the same thing whatever step size you use to simulate it.
Why it is useful
Many systems have a clear average behaviour plus unavoidable fluctuations. An SDE captures both in one line, and it can be simulated, solved in special cases, and studied with probability tools. It is the continuous-time version of the Markov chain idea: the next change depends on the present state, not the history that led there.
The math
Definition
Let be a process, the drift and the diffusion coefficient. The SDE
means that solves the integral equation
where the second integral is an Itô integral against a Brownian motion .
Here is the starting value, says which way the quantity tends to move, and sets how strongly random shocks push it. Both coefficients may depend on the current state and the time . When the equation reduces to the ordinary differential equation , which is why the SDE is the natural generalisation.
Existence and uniqueness
If and are Lipschitz in (their slope is bounded everywhere) and grow at most linearly, then a unique solution exists for every starting value. This is the stochastic analogue of the existence theorem for ODEs. Without these conditions the solution can blow up in finite time, just as an ODE can.
Solving linear SDEs: the Ornstein-Uhlenbeck process
The simplest SDE with a useful solution is
The drift pulls back toward zero at rate , and the noise keeps kicking it away. To solve it, multiply by the integrating factor . Define . Itô's product rule gives
The terms cancel, which is the whole point of the trick. Integrating from to and dividing by gives
Because the integrand is deterministic, the Itô integral is a Gaussian with mean zero, so is Gaussian. Its mean and variance are
As grows, the variance tends to . This is the stationary distribution of the process.
Geometric Brownian motion
The SDE
models a price that grows at a steady percentage rate with percentage volatility . Its solution comes from Itô's lemma applied to , with and . Since ,
Integrating gives
The correction is the Itô term at work. It is why the median of grows more slowly than the mean.
Numerical solution: Euler-Maruyama
Most SDEs have no closed form. The Euler-Maruyama scheme discretises time in steps of size . Since a Brownian increment over has standard deviation , the update is
This is the SDE analogue of the Euler method for ODEs, with the extra on the noise. Its error shrinks like in the strong sense, which is slower than the you get from Euler on an ODE.
Worked examples
Take , , , and look at time .
- Mean: .
- Variance: .
- Standard deviation: .
- Interpretation: after one unit of time, the typical value is about . The starting value has pulled the mean down by more than half, and the noise has spread the answer over a range of roughly two-thirds of a unit.
- Stationary check: as the variance tends to , a standard deviation of . The value at is already close to that level.
Use the same SDE with step size , starting at , and draw .
- Drift term: .
- Noise term: .
- Sum: .
- Interpretation: the drift moved the value down by a fixed amount, and the noise pushed it slightly back up. The exact solution for has mean , so the Euler step lands in the right region. Over many steps the scheme converges to the exact distribution as shrinks.
Let , , , and suppose the noise over the year came out as .
- Exponent drift: .
- Exponent noise: .
- Exponent total: .
- Price: .
- Interpretation: a price that drifts at 8 percent a year but happened to get a favourable shock ends at 117.35. The Itô term is already included in the 0.06 above, so the outcome is not inflated by it.
Tradeoffs and failure modes
SDEs are the right model when a state changes continuously and noise is a real part of the system. They are the wrong model when the noise is better described by jumps, or when the state is discrete.
| Situation | Problem | Better choice |
|---|---|---|
| Prices with sudden crashes | Continuous diffusion underestimates tail risk | SDE with a jump term (jump-diffusion) |
| Closed form needed for a nonlinear SDE | Most nonlinear SDEs have no closed form | Euler-Maruyama or Milstein simulation |
| Many small steps needed for accuracy | Strong error shrinks only like | Higher-order schemes such as Milstein |
| Noise is coloured (correlated in time) | Standard Brownian increments are independent | SDE driven by a different noise process |
| Discrete-time data | Continuous model is an approximation | Fit a discrete model, such as an AR process |
The most common mistake is to treat the noise like ordinary calculus. If you apply the usual chain rule to and forget the second-order Itô term, you get the wrong drift. The geometric Brownian motion example shows the size of the error: the term puts the median below the mean by a factor of .
Another failure is a non-Lipschitz coefficient. The equation may still have a solution, but a naive simulation can diverge, and the answer depends on the discretisation.
History
Louis Bachelier modelled stock prices as random walks in his 1900 thesis, before Einstein's 1905 analysis of Brownian motion in physics. Paul Langevin wrote down a stochastic equation of motion for a particle in a fluid in 1908, adding a random force to Newton's law. Its drift and noise structure is the template for what we now call an SDE.
Kiyosi Itô gave the rigorous foundation in 1944 by defining the stochastic integral and proving the change-of-variables rule that now bears his name. Ornstein and Uhlenbeck studied the linear equation that carries their names in 1930 as a model of velocity in Brownian motion. Its mean-reverting behaviour made it popular in physics and later in finance.
SDEs caught on in finance after Fischer Black, Myron Scholes and Robert Merton used a geometric Brownian motion to price options in 1973. In machine learning they became central again when diffusion models treated image generation as the reverse of a noising SDE.
Check yourself
QuestionWhat does the drift term contribute over a short time step , and how does the noise term scale with ?Show answer
The drift contributes , which is proportional to . The noise contributes , whose size is proportional to . So over short intervals the noise dominates the drift, because is much larger than when is small.
QuestionFor the Ornstein-Uhlenbeck process with and , what is the stationary variance?Show answer
The stationary variance is . Setting in the variance formula kills the exponential term, leaving .
QuestionWhy does the geometric Brownian motion solution have in the exponent?Show answer
It is the Itô correction. Applying Itô's lemma to produces a term, because is not zero. In ordinary calculus this term would vanish, and the exponent would be instead.
QuestionA trader models a stock with geometric Brownian motion. Why might the model underprice a deep out-of-the-money put?Show answer
Geometric Brownian motion has continuous paths and log-normal returns, so large drops are very unlikely. Real markets have sudden crashes that put more probability on extreme losses than a log-normal does. A jump-diffusion model, which adds a jump term to the SDE, puts more weight on those tails and gives a higher price for deep out-of-the-money puts.