Tutorials › Stochastic Calculus › Weak Error for Smooth Test Functions

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

Weak Error for Smooth Test Functions

Learn to distinguish weak bias from pathwise error and to identify the smoothness and integrability assumptions needed for weak-rate estimates.

Intermediate 12 min read

What You'll Learn

  • Define weak error for a specified test function and distinguish it from strong error.
  • Express global weak error as a sum of one-step defects using transition operators.
  • Use a Lipschitz test function to bound weak error by a coupled strong error.
  • See why discontinuous test functions can defeat bounds based only on pathwise closeness.
  • Identify sufficient coefficient and test-function regularity for Euler–Maruyama weak-rate estimates.

Weak Error Measures Bias in Expectations

Numerical paths are often used to estimate quantities such as \(\mathbb{E}[f(X_T)]\), where \(X_T\) is the solution of an SDE and \(f\) is a chosen observable. A discretization can have noticeable pathwise error but a small error in this expectation: positive and negative deviations may cancel after averaging. Conversely, an observable that changes sharply can turn a small pathwise discrepancy into a large expectation error. Weak error describes the first kind of discrepancy, for a specified test function.

Work on a filtered probability space \((\Omega,\mathcal{F},(\mathcal{F}_t)_{t\ge0},\mathbb{P})\) carrying a Brownian motion \(B_t\). Consider the scalar SDE \(dX_t=\mu(X_t)\,dt+\sigma(X_t)\,dB_t\), with deterministic initial value \(X_0=x_0\). Here \(\mu\) is the drift and \(\sigma\) is the diffusion coefficient. Unless stated otherwise, assume they are globally Lipschitz and have at most linear growth: for some \(L,C<\infty\), \(|\mu(x)-\mu(y)|+|\sigma(x)-\sigma(y)|\le L|x-y|\) and \(|\mu(x)|+|\sigma(x)|\le C(1+|x|)\). These conditions ensure a unique strong solution with finite second moments on each bounded time interval. The stochastic integral in the integral form of the SDE is the Ito integral; its integrand \(\sigma(X_s)\) is adapted and progressively measurable, and satisfies \(\mathbb{E}\int_0^T \sigma(X_s)^2\,ds<\infty\) under these assumptions.

On a uniform grid \(t_n=nh\), \(h=T/N\), Euler–Maruyama is defined by \(X^h_{n+1}=X^h_n+\mu(X^h_n)h+\sigma(X^h_n)(B_{t_{n+1}}-B_{t_n})\), starting from \(X^h_0=x_0\). A test function \(f\) is a measurable function for which the expectations below exist.

Definition: The signed weak error at time \(T\), for test function \(f\), is \(e_{\mathrm{w}}(f,T,h)=\mathbb{E}[f(X_T)]-\mathbb{E}[f(X^h_N)]\). Its absolute weak error is \(|e_{\mathrm{w}}(f,T,h)|\). The strong error instead compares the random variables on a common probability space, for example through \(\mathbb{E}|X_T-X^h_N|\) or \((\mathbb{E}|X_T-X^h_N|^2)^{1/2}\). The weak error depends on \(f\); it is not a distance between paths.

In the usual rate statement, weak order one means that, for fixed \(T\), there is a constant \(C_{f,T}\) independent of \(h=T/N\) such that \(|e_{\mathrm{w}}(f,T,h)|\le C_{f,T}h\) for sufficiently small \(h\). The constant may depend on the coefficients, the time horizon, the initial value, and the test function. This is an upper bound, not a claim that the error is exactly proportional to \(h\): the signed error can vanish or decay faster for special choices of \(f\).

A Coupling Bound and Its Limits

Strong and weak errors are related when the test function is Lipschitz. Two random variables \(U,V\) are coupled if they are defined on the same probability space; no independence is required. A function \(f:\mathbb{R}\to\mathbb{R}\) is Lipschitz with constant \(L_f\) if \(|f(x)-f(y)|\le L_f|x-y|\) for all \(x,y\).

Proposition: If \(U,V\) are coupled, \(f\) is Lipschitz with constant \(L_f\), and \(\mathbb{E}|U-V|^2<\infty\), then \(|\mathbb{E}f(U)-\mathbb{E}f(V)|\le L_f\mathbb{E}|U-V|\le L_f(\mathbb{E}|U-V|^2)^{1/2}\), provided the expectations of \(f(U)\) and \(f(V)\) exist.

Proof. Linearity of expectation and the triangle inequality give \(|\mathbb{E}f(U)-\mathbb{E}f(V)|=|\mathbb{E}(f(U)-f(V))|\le\mathbb{E}|f(U)-f(V)|\). The Lipschitz condition bounds the last expression by \(L_f\mathbb{E}|U-V|\). Cauchy–Schwarz, applied to \(|U-V|\) and the constant random variable \(1\), gives \(\mathbb{E}|U-V|\le(\mathbb{E}|U-V|^2)^{1/2}\). The second-moment assumption makes these bounds finite. \(\square\)

In particular, a strong mean-square error bound of order \(h^{1/2}\) implies a weak error bound of order \(h^{1/2}\) for Lipschitz tests. It does not by itself give weak order one. A sharper weak rate can arise from cancellation in the expectation, but establishing that cancellation requires additional analysis of the scheme and typically greater smoothness of the coefficients and the test function.

Worked Example: Equal Means, Different Strong Errors

Take \(X_0=1\), \(dX_t=X_t\,dB_t\), and one Euler–Maruyama step of length \(h=\tfrac12\). Compare the weak error for \(f(x)=x\) with the mean-square coupling error, using the same Brownian increment \(Z=B_h-B_0\sim N(0,h)\).

The exact solution is \(X_h=\exp(Z-\tfrac12h)\). Ito's formula verifies it: for \(F(t,z)=\exp(z-\tfrac12t)\), \(F_t=-\tfrac12F\), \(F_z=F\), and \(F_{zz}=F\); the Ito correction is \(\tfrac12F_{zz}\,dt=\tfrac12F\,dt\). Thus \(dF=F\,dB_t\). The integrand \(X_t\) is adapted and progressively measurable, and \(\mathbb{E}\int_0^h X_t^2\,dt=\int_0^h e^t\,dt<\infty\). Euler gives \(X^h_1=1+Z\).

The normal moment-generating function yields \(\mathbb{E}e^{Z-h/2}=1\) and \(\mathbb{E}Z=0\). Hence the weak error for \(f(x)=x\) is \(1-1=0\). For the mean-square error, first compute \(\mathbb{E}X_h^2=e^h\) and \(\mathbb{E}(X^h_1)^2=1+h\). Also, \(\mathbb{E}[X_hX^h_1]=\mathbb{E}[e^{Z-h/2}(1+Z)]=1+h\), by differentiating the normal moment-generating function. Therefore \(\mathbb{E}|X_h-X^h_1|^2=e^h+(1+h)-2(1+h)=e^h-1-h\).

Check: with \(h=\tfrac12\), this is \(e^{1/2}-1-\tfrac12=e^{1/2}-\tfrac32\), which is positive (approximately \(0.1487\)). The same coupling has zero weak error for the identity test, despite a nonzero mean-square error. This is cancellation in one observable, not exact agreement of the random variables.

Why Test-Function Regularity Matters

The coupling proposition explains one role of regularity: a Lipschitz function cannot magnify a small difference by more than its Lipschitz constant. Smoothness also matters when deriving higher weak rates. Taylor expansion averages increments rather than taking their absolute values, so odd centered Gaussian terms can cancel. To use this mechanism with controlled remainders, one needs derivatives of the test function and enough regularity of the coefficients.

Worked Example: A Discontinuous Test Can Magnify a Small Error

Let \(U=0\) and \(V=\varepsilon\), where \(\varepsilon>0\) is deterministic. The variables are coupled on any probability space and \(\mathbb{E}|U-V|^2=\varepsilon^2\). For the Lipschitz test \(f(x)=x\), the absolute weak error is \(|f(0)-f(\varepsilon)|=\varepsilon\), exactly the coupling distance.

Now use \(g(x)=\mathbf{1}_{(0,\infty)}(x)\), which is discontinuous at zero. Then \(\mathbb{E}g(U)=0\), since \(0\notin(0,\infty)\), while \(\mathbb{E}g(V)=1\). The absolute weak error is \(1\), for every \(\varepsilon>0\), even though the mean-square distance is \(\varepsilon^2\) and tends to zero.

Check: the strict inequality in the set \((0,\infty)\) is essential here: \(g(0)=0\), whereas \(g(\varepsilon)=1\). Thus small strong error alone cannot give a uniform weak-error estimate for arbitrary measurable tests. Smoothness or another suitable regularity condition must be part of a rate claim.

For Euler–Maruyama, a standard sufficient setting for a weak order-one estimate is that \(\mu\) and \(\sigma\) are globally Lipschitz with bounded continuous derivatives through order four, and that \(f\) has bounded continuous derivatives through order four. In that setting, for fixed \(T\), a standard weak order-one result gives \(|\mathbb{E}f(X_T)-\mathbb{E}f(X^h_N)|\le C_{f,T}h\). The constant is not asserted to be uniform over all such test functions. The proof of this rate is the subject of the subsequent weak-order analysis; the statement here records the regularity it uses, rather than deriving the rate.

These bounded smoothness assumptions are convenient sufficient conditions, not necessary conditions in every individual problem. Variants allow derivatives and coefficients of polynomial growth, provided appropriate moment bounds are available and the test function has matching growth and integrability. A rate statement must specify which version is being used. For instance, a polynomially growing \(f\) requires enough moments of both the exact solution and the approximation for \(\mathbb{E}|f(X_T)|\) and \(\mathbb{E}|f(X^h_N)|\) to be finite.

Global Error as a Sum of One-Step Defects

A useful way to organize a weak-error proof is to separate the one-step discrepancy from the way later steps act on it. Assume the SDE is time-homogeneous and Markov, and define its exact transition operator \(P_h\) and the Euler transition operator \(Q_h\) by \(P_hg(x)=\mathbb{E}[g(X_h^x)]\) and \(Q_hg(x)=\mathbb{E}[g(x+\mu(x)h+\sigma(x)\sqrt{h}\,Z)]\), where \(X_0^x=x\) and \(Z\sim N(0,1)\). The exact transition expectation is well-defined for functions with suitable integrability. The Euler expectation uses one fresh normal increment at each step.

Proposition: If the transition expectations exist, \(X_0=x_0\), and \(T=Nh\), then \(\mathbb{E}f(X_T)-\mathbb{E}f(X^h_N) =\sum_{k=0}^{N-1}\mathbb{E}\big[(Q_h^k(P_h-Q_h)P_h^{N-1-k}f)(x_0)\big]\). Here operator powers denote repeated application, and \(Q_h^0=P_h^0\) is the identity operator.

Proof. The Markov property gives \(\mathbb{E}f(X_T)=(P_h^Nf)(x_0)\); the independent Brownian increments in Euler–Maruyama give \(\mathbb{E}f(X^h_N)=(Q_h^Nf)(x_0)\). For any two operators \(A,B\) whose displayed compositions are defined, \(A^N-B^N=\sum_{k=0}^{N-1}B^k(A-B)A^{N-1-k}\). Indeed, the \(k\)-th summand is \(B^kA^{N-k}-B^{k+1}A^{N-1-k}\); summing makes consecutive terms cancel, leaving \(A^N-B^N\). Taking \(A=P_h\), \(B=Q_h\), and evaluating at \(x_0\) gives the formula. If \(N=0\), the sum is empty and both sides are zero, so the identity includes that degenerate case as well. \(\square\)

This identity does not by itself give a rate: it isolates the one-step defect \((P_h-Q_h)g\), but that defect is applied to functions \(g=P_h^{N-1-k}f\), whose derivatives and growth must also be controlled. A weak-rate proof therefore needs both a local comparison and bounds that remain valid as the test function is propagated through the transition operators. This is one reason coefficient regularity and test-function regularity appear together in sufficient hypotheses.

Worked Example: One-Step Euler Expectation for a Smooth Test

At state \(x=1\), take frozen drift \(\mu=1\), diffusion coefficient \(\sigma=2\), step \(h=\tfrac14\), and test \(f(x)=x^4\). For this one-step Euler transition, \(Y=1+\tfrac14+2\sqrt{\tfrac14}Z=\tfrac54+Z\), where \(Z\sim N(0,1)\). The normal moments are \(\mathbb{E}Z=0\), \(\mathbb{E}Z^2=1\), \(\mathbb{E}Z^3=0\), and \(\mathbb{E}Z^4=3\). Expanding, \(\mathbb{E}f(Y)=(\tfrac54)^4+6(\tfrac54)^2\mathbb{E}Z^2+3=\tfrac{625}{256}+\tfrac{150}{16}+3=\tfrac{3793}{256}\).

To identify the first-order term, the generator is \(\mathcal{L}f(x)=\mu f'(x)+\tfrac12\sigma^2 f''(x)\). Here \(f'(x)=4x^3\), \(f''(x)=12x^2\), so at \(x=1\), \(\mathcal{L}f(1)=4+\tfrac12(4)(12)=28\). The first-order expression \(f(1)+h\mathcal{L}f(1)\) is \(1+\tfrac14(28)=8\). The exact Euler expectation is \(\tfrac{3793}{256}\), so the difference from this first-order expression is \(\tfrac{3793}{256}-8=\tfrac{1745}{256}\).

Check: directly expanding \((\tfrac54+Z)^4\) gives \((\tfrac54)^4+6(\tfrac54)^2+3\), the same \(\tfrac{3793}{256}\). This finite step illustrates why a first-order generator term is not an exact finite-step formula: higher-order contributions remain. Rate estimates control those remainders as \(h\) decreases, with smoothness assumptions ensuring the derivatives and expectations used in the estimates are available.

Common Pitfalls and Practical Interpretation

A weak error statement is incomplete if it does not name the test function, the time horizon, and the limiting regime. The expressions \(\mathbb{E}f(X_T)\) and \(\mathbb{E}f(X^h_N)\) must both be finite. When reporting a rate, keep the test function fixed (or specify a norm over a stated family of tests) and let \(h=T/N\) tend to zero with \(T\) fixed.

A common mistake is to replace weak error by the mean-square path error. For example, concluding that an \(O(h^{1/2})\) strong error automatically proves an \(O(h)\) weak error is invalid: the coupling bound only transfers the available strong rate. Conversely, a small weak error for one \(f\) does not imply that the simulated paths are close; the identity test in the worked example had zero weak error while the mean-square discrepancy was positive.

Finally, do not assume that all test functions qualify for the same rate. Bounded smooth tests are compatible with standard Taylor-based estimates; indicators and other discontinuous functions may require separate distributional or smoothing arguments. The one-step-defect decomposition clarifies the strategy: specify the observable, control the local weak defect for the functions that occur, and ensure coefficient and moment conditions support those bounds.

Check Your Understanding

Use the definitions and results above to answer the following.

  1. For a Lipschitz test \(f\), what coupled strong-error quantity bounds the absolute weak error?
  2. Why does a zero weak error for one test function not imply that the exact and numerical endpoints agree almost surely?
  3. In the transition-operator identity, what is the one-step defect, and why is its size alone not automatically a global rate?
  4. What can go wrong if the test function is an indicator and the two coupled random variables are close but lie on opposite sides of its threshold?
  5. State a convenient set of sufficient smoothness assumptions for the standard Euler–Maruyama weak order-one estimate, and identify which quantities its constant may depend on.