Tutorials › Stochastic Calculus › Vector Euler-Maruyama and Correlated Noise

Simulating SDEs: Euler-Maruyama and Milstein · Tutorial 514 of 600

Vector Euler-Maruyama and Correlated Noise

Learn how to assemble and verify vector Euler–Maruyama steps when the state and Brownian noise have multiple components.

Intermediate 11 min read

What You'll Learn

  • Write the vector Euler–Maruyama update for a state in any finite dimension.
  • Match the dimensions of the drift, diffusion matrix, and Brownian increment.
  • Represent correlated Brownian increments using a covariance matrix and a matrix factor.
  • Compute conditional means and covariances of one numerical step.
  • Check numerical updates and identify errors in time-step scaling.

From Scalar Updates to Vector Updates

In a scalar Euler–Maruyama step, the drift contributes a time-step multiple and the diffusion contributes a Brownian increment. In a vector SDE, the same principle applies, but the diffusion coefficient is a matrix: each component of the state can respond to several Brownian drivers. If those drivers are correlated, their covariance must also enter the update. Keeping the dimensions and covariance structure explicit prevents errors that can be hard to detect from a simulated path alone.

Work on a filtered probability space \((\Omega,\mathcal{F},(\mathcal{F}_t)_{t\ge0},\mathbb{P})\) carrying a standard \(d\)-dimensional Brownian motion \(\mathbf{B}_t=(B_t^1,\ldots,B_t^d)^\mathsf{T}\), whose components are independent standard Brownian motions. Consider an \(m\)-dimensional state \(X_t\) satisfying the Ito SDE

$$ dX_t=\mu(t,X_t)\,dt+\sigma(t,X_t)\,d\mathbf{B}_t. $$

Here \(\mu(t,x)\in\mathbb{R}^m\) is the drift coefficient and \(\sigma(t,x)\in\mathbb{R}^{m\times d}\) is the diffusion matrix. The stochastic integral in this equation is understood componentwise as an Ito integral: each row of \(\sigma(t,X_t)\) is progressively measurable and square-integrable, meaning that for each finite \(T\), \(\mathbb{E}\int_0^T\|\sigma(t,X_t)\|^2\,dt<\infty\). The corresponding drift integral is an ordinary time integral, with the required integrability of \(\mu(t,X_t)\).

Take a time grid \(t_n=nh\), where \(h>0\), and write \(\Delta\mathbf{B}_n=\mathbf{B}_{t_{n+1}}-\mathbf{B}_{t_n}\). The increment is a \(d\)-vector with independent \(N(0,h)\) components, independent of \(\mathcal{F}_{t_n}\). Euler–Maruyama freezes both coefficients at the left endpoint of each step.

Definition: The vector Euler–Maruyama recursion is \(X_{n+1}=X_n+\mu(t_n,X_n)h+\sigma(t_n,X_n)\Delta\mathbf{B}_n\). The drift term is an \(m\)-vector; the product of the \(m\times d\) diffusion matrix and the \(d\)-vector Brownian increment is also an \(m\)-vector.

This is an Ito discretization. It uses the Ito SDE’s drift and diffusion as given; one does not insert an additional Stratonovich correction into the numerical step. The factors \(h\) and \(\sqrt{h}\) have distinct roles: the drift is multiplied by \(h\), while a Brownian increment has typical size \(\sqrt{h}\).

Why the Matrix Update Has This Form

Proposition: Suppose \(X_n\) is \(\mathcal{F}_{t_n}\)-measurable and the coefficients at \((t_n,X_n)\) have finite second moments. For the Euler–Maruyama step driven by standard \(d\)-dimensional Brownian motion, \(\mathbb{E}[X_{n+1}\mid\mathcal{F}_{t_n}]=X_n+h\mu(t_n,X_n)\), and the conditional covariance matrix of the step’s random part is \(h\sigma(t_n,X_n)\sigma(t_n,X_n)^\mathsf{T}\).

Proof. Set \(\mu_n=\mu(t_n,X_n)\), \(\sigma_n=\sigma(t_n,X_n)\), and \(\Delta\mathbf{B}_n=\Delta\mathbf{B}\). Since \(X_n,\mu_n,\sigma_n\) are known at time \(t_n\), and the Brownian increment is independent of \(\mathcal{F}_{t_n}\), its conditional mean is zero and its conditional covariance is \(hI_d\), where \(I_d\) is the \(d\times d\) identity matrix. Thus the conditional mean of \(\sigma_n\Delta\mathbf{B}\) is zero, giving the stated conditional mean. For the covariance, subtract the conditional mean from the update; the random part is \(\sigma_n\Delta\mathbf{B}\). Therefore

$$ \mathbb{E}\!\left[(\sigma_n\Delta\mathbf{B})(\sigma_n\Delta\mathbf{B})^\mathsf{T}\mid\mathcal{F}_{t_n}\right] =\sigma_n\,\mathbb{E}\!\left[\Delta\mathbf{B}(\Delta\mathbf{B})^\mathsf{T}\mid\mathcal{F}_{t_n}\right]\sigma_n^\mathsf{T} =h\sigma_n\sigma_n^\mathsf{T}. $$

Finite second moments ensure these conditional expectations are defined. The formula gives the covariance of the one-step random part, not a claim that the entire discretization is an exact transition law for the SDE. \(\square\)

This calculation is also a useful dimension check: \(\sigma_n\sigma_n^\mathsf{T}\) is \(m\times m\), the covariance dimension required for an \(m\)-dimensional state. Its off-diagonal entries describe the covariance between different state components generated during one step.

Worked Vector Updates

Worked Example: Two State Components and Two Independent Drivers

At one step, let \(h=\tfrac14\), \(X_n=(1,2)^\mathsf{T}\), and \(\Delta\mathbf{B}_n=(\tfrac12,-\tfrac12)^\mathsf{T}\). Use the coefficients \(\mu(x_1,x_2)=(x_2,-x_1)^\mathsf{T}\) and \(\sigma=\begin{pmatrix}1&2\\-1&1\end{pmatrix}\). Compute the update.

First evaluate the drift at the current state: \(\mu(1,2)=(2,-1)^\mathsf{T}\). Its time-step contribution is \(\tfrac14(2,-1)^\mathsf{T}=(\tfrac12,-\tfrac14)^\mathsf{T}\). Next multiply the diffusion matrix by the increment:

$$ \begin{pmatrix}1&2\\-1&1\end{pmatrix} \begin{pmatrix}\tfrac12\\-\tfrac12\end{pmatrix} = \begin{pmatrix}\tfrac12-1\\-\tfrac12-\tfrac12\end{pmatrix} = \begin{pmatrix}-\tfrac12\\-1\end{pmatrix}. $$

Adding the state, drift contribution, and diffusion contribution gives \(X_{n+1}=(1,2)^\mathsf{T}+(\tfrac12,-\tfrac14)^\mathsf{T}+(-\tfrac12,-1)^\mathsf{T}=(1,\tfrac34)^\mathsf{T}\).

Check: the first component is \(1+\tfrac12-\tfrac12=1\), and the second is \(2-\tfrac14-1=\tfrac34\). Both terms being added are two-vectors, as required.

Correlated Brownian Drivers

Sometimes the model is written with a Brownian driver whose components have instantaneous correlations rather than with independent components. Let \(\mathbf{W}_t\) be a \(d\)-dimensional Brownian motion with covariance matrix \(R\), where \(R\) is symmetric positive semidefinite. This means its increment over a time interval of length \(h\) has mean zero and covariance \(hR\). Choose a matrix \(C\) such that \(CC^\mathsf{T}=R\). Such a factor exists for every symmetric positive semidefinite matrix, including singular ones. Equivalently, write \(\Delta\mathbf{W}_n=C\Delta\mathbf{Z}_n\), where \(\mathbf{Z}\) has independent standard Brownian components.

For the SDE \(dX_t=\mu(t,X_t)\,dt+A(t,X_t)\,d\mathbf{W}_t\), the update can be implemented using independent normal increments as \(X_{n+1}=X_n+\mu(t_n,X_n)h+A(t_n,X_n)C\Delta\mathbf{Z}_n\). Here \(A\) is \(m\times d\), and \(C\) is \(d\times d\). Alternatively, generate the correlated increment \(\Delta\mathbf{W}_n\) directly and use \(A\Delta\mathbf{W}_n\). These are equivalent constructions because their increment covariances agree.

Proposition: For a correlated driver with increment covariance \(hR\), the one-step random part \(A(t_n,X_n)\Delta\mathbf{W}_n\) has conditional covariance \(hA(t_n,X_n)R A(t_n,X_n)^\mathsf{T}\).

Proof. Write \(A_n=A(t_n,X_n)\). Since \(A_n\) is known at time \(t_n\), and the increment is independent of the past with conditional mean zero and covariance \(hR\), the conditional covariance is

$$ \mathbb{E}\!\left[(A_n\Delta\mathbf{W}_n)(A_n\Delta\mathbf{W}_n)^\mathsf{T}\mid\mathcal{F}_{t_n}\right] =A_n(hR)A_n^\mathsf{T} =hA_n R A_n^\mathsf{T}. $$

Using \(\Delta\mathbf{W}_n=C\Delta\mathbf{Z}_n\) gives the same matrix, because \(A_nCC^\mathsf{T}A_n^\mathsf{T}=A_nRA_n^\mathsf{T}\). \(\square\)

Worked Example: Constructing a Correlated Increment

Let there be two drivers with correlation \(\rho=\tfrac35\), and take \(h=\tfrac14\). Use independent standard normal values \(Z_1=1\) and \(Z_2=0\) for this step. Construct the correlated increments and update the state for \(X_n=(0,0)^\mathsf{T}\), drift \(\mu=(0,1)^\mathsf{T}\), and diffusion matrix \(A=\begin{pmatrix}1&0\\0&2\end{pmatrix}\).

The covariance matrix is \(R=\begin{pmatrix}1&\tfrac35\\\tfrac35&1\end{pmatrix}\). A factor is \(C=\begin{pmatrix}1&0\\\tfrac35&\tfrac45\end{pmatrix}\), since \(CC^\mathsf{T}=\begin{pmatrix}1&\tfrac35\\\tfrac35&\tfrac9{25}+\tfrac{16}{25}\end{pmatrix}=R\). The independent increment is \(\sqrt{h}(Z_1,Z_2)^\mathsf{T}=(\tfrac12,0)^\mathsf{T}\), so the correlated increment is \(\Delta\mathbf{W}_n=C(\tfrac12,0)^\mathsf{T}=(\tfrac12,\tfrac3{10})^\mathsf{T}\).

The drift contribution is \(h\mu=(0,\tfrac14)^\mathsf{T}\). The diffusion contribution is \(A\Delta\mathbf{W}_n=(\tfrac12,\tfrac35)^\mathsf{T}\). Hence \(X_{n+1}=(\tfrac12,\tfrac14+\tfrac35)^\mathsf{T}=(\tfrac12,\tfrac{17}{20})^\mathsf{T}\).

Check: \(\tfrac{17}{20}=\tfrac5{20}+\tfrac{12}{20}\), matching the second component’s drift and diffusion contributions. The conditional covariance is \(hARA^\mathsf{T}=\begin{pmatrix}\tfrac14&\tfrac3{10}\\\tfrac3{10}&1\end{pmatrix}\): its off-diagonal entry is \(\tfrac14\cdot 1\cdot\tfrac35\cdot2=\tfrac3{10}\), and its lower-right entry is \(\tfrac14\cdot2^2=1\).

Worked Example: A State-Dependent Diffusion Row

For a scalar state driven by two independent Brownian motions, take \(\mu(x)=-x\), \(\sigma(x)=(x,1)\), \(X_n=2\), \(h=\tfrac14\), and \(\Delta\mathbf{B}_n=(\tfrac12,-\tfrac14)^\mathsf{T}\). Compute one step and its conditional variance.

The drift contribution is \(-2\cdot\tfrac14=-\tfrac12\). The diffusion row evaluated at \(x=2\) is \((2,1)\), so its product with the increment is \(2\cdot\tfrac12+1\cdot(-\tfrac14)=1-\tfrac14=\tfrac34\). The updated value is \(X_{n+1}=2-\tfrac12+\tfrac34=\tfrac94\).

At \(X_n=2\), the conditional variance of the random part is \(h\sigma(2)\sigma(2)^\mathsf{T}=\tfrac14(2^2+1^2)=\tfrac54\). Check: the diffusion row has squared Euclidean length \(4+1=5\), so multiplying by \(h=\tfrac14\) gives \(\tfrac54\). The realized increment \(\tfrac34\) is one outcome; it is not itself the variance.

Practical Checks and a Common Mistake

For a simulation, generate one increment for each Brownian driver on each time interval. With independent drivers, each coordinate is \(\sqrt{h}Z_j\), where the \(Z_j\) are independent standard normal random variables. With correlated drivers, apply a covariance factor to that vector, or generate increments with covariance \(hR\) directly. The same factorization must be applied at every step if the model specifies a constant correlation matrix.

A common mistake is to multiply a standard normal draw by \(h\), instead of by \(\sqrt{h}\). For example, with \(h=\tfrac14\) and \(Z=1\), the Brownian increment is \(\sqrt{\tfrac14}\cdot1=\tfrac12\), not \(\tfrac14\). Using \(\tfrac14\) would give a diffusion contribution half as large in this step. The correction is to construct increments with variance \(h\), since \(\operatorname{Var}(\sqrt{h}Z)=h\operatorname{Var}(Z)=h\). In the correlated case, the corresponding target is covariance \(hR\), not \(h^2R\).

Euler–Maruyama produces a discrete approximation. In a strong simulation, the numerical path is driven by specified Brownian increments; in a weak simulation, the aim is to reproduce expectations of suitable functions of the solution. Neither interpretation makes a finite-step update an exact SDE solution. Error and convergence rates require additional analysis and assumptions on the coefficients; the conditional mean and covariance formulas above describe the step, not those rates.

Check Your Understanding

For each question, keep the state dimension, driver dimension, and increment covariance distinct.

  1. If \(X\in\mathbb{R}^3\) is driven by a two-dimensional Brownian motion, what are the dimensions of \(\mu\), \(\sigma\), and \(\Delta\mathbf{B}_n\)?
  2. For an independent \(d\)-dimensional Brownian driver, what is the conditional covariance of the Euler step’s random part?
  3. Given \(R=\begin{pmatrix}1&\rho\\\rho&1\end{pmatrix}\), verify that \(C=\begin{pmatrix}1&0\\\rho&\sqrt{1-\rho^2}\end{pmatrix}\) satisfies \(CC^\mathsf{T}=R\) when \(|\rho|\le1\).
  4. For a step size \(h=\tfrac1{16}\), what factor multiplies a standard normal draw to produce a Brownian increment of variance \(h\)?
  5. Explain why a nonzero off-diagonal entry of \(A R A^\mathsf{T}\) can arise even when the state components have separate update equations.