Tutorials › Stochastic Differential Equations in Pharmacokinetics › When a Positive Grid Path Hides an Invalid Continuous Model

Positivity-Preserving Models and Simulation · Tutorial 52 of 100

When a Positive Grid Path Hides an Invalid Continuous Model

Learn to distinguish a model that preserves nonnegativity continuously from a path that merely has positive recorded values, and to refine intervals where boundary crossing is plausible.

Advanced 12 min read

What You'll Learn

  • Test whether drift and diffusion satisfy a boundary condition for nonnegative states.
  • Prove a nonnegativity result for globally Lipschitz one-dimensional SDEs.
  • Calculate the chance that a Brownian path crosses zero between positive endpoints.
  • Use crossing risk to target path refinement rather than relying only on a positive grid.
  • Recognize when bridge calculations are exact and when they are only approximations.
  • Explain why clipping negative values does not validate the underlying continuous model.

Why Positive Grid Values Are Not Enough

A simulation may record a concentration as positive at every requested time and still represent a process that becomes negative between those times. The distinction is between grid positivity, a statement about finitely many recorded values, and continuous-path nonnegativity, a statement about every time in an interval. For a concentration model whose state space is nonnegative, the second is the relevant modeling property.

There are two complementary checks. First, inspect the stochastic differential equation at the boundary: does its drift and diffusion support a nonnegative state space? Second, assess whether a path could cross the boundary between the times actually inspected. A finer output grid can reveal some hidden crossings, but unless it is coupled to a valid continuous-path argument, it cannot certify that no crossing occurred.

Definition: A process \(X_t\) is nonnegative on \([0,T]\) if \(P(X_t\geq 0\text{ for every }t\in[0,T])=1\). A path is grid-positive on \(0=t_0<t_1<\cdots<t_m=T\) if \(X_{t_i}\geq0\) for every grid index \(i\). Grid positivity alone does not imply process nonnegativity.

Boundary Conditions as a Model Diagnostic

Consider the one-dimensional Itô SDE \(dX_t=b(X_t)\,dt+\sigma(X_t)\,dW_t\), where \(W_t\) is standard Brownian motion. The coefficients describe both the local direction of average change and the size of random fluctuations. At the boundary \(0\), diffusion pointing freely in either direction is incompatible with a nonnegative state space; a drift pointing outward from the boundary is also problematic.

Theorem: Suppose \(b\) and \(\sigma\) are globally Lipschitz on \(\mathbb{R}\), \(\sigma(0)=0\), and \(b(0)\geq0\). For the unique strong solution with deterministic initial value \(X_0\geq0\), \(P(X_t\geq0\text{ for every }t\geq0)=1\).

The global Lipschitz assumption ensures existence and uniqueness without explosion and gives the moment bounds needed below. The theorem is a useful sufficient boundary test, not a claim that every model with nonnegative paths must have globally Lipschitz coefficients. The coefficients are considered on the real line, so their behavior just below zero is part of the test.

Proof. Let \(f(x)=(x^-)^2\), where \(x^-=\max(-x,0)\). This function is continuously differentiable, with \(f'(x)=2x\) for \(x<0\) and \(f'(x)=0\) for \(x\geq0\); its second derivative is \(2\) on \(x<0\) and \(0\) on \(x>0\). Itô's formula applies to this function, whose first derivative is locally absolutely continuous. For \(x<0\), Lipschitz continuity and \(\sigma(0)=0\) give \(|\sigma(x)|\leq L|x|\). Also, using the lower Lipschitz bound on the drift, \(b(x)\geq b(0)-L|x|\). Since \(2x<0\), multiplication reverses this inequality:

$$ 2xb(x)\leq 2x\bigl(b(0)-L|x|\bigr) =2xb(0)+2Lx^2\leq 2Lx^2. $$

The last inequality follows from \(b(0)\geq0\) and \(x<0\). Thus, for \(x<0\),

$$ 2xb(x)+\sigma(x)^2\leq (2L+L^2)x^2. $$

Apply Itô's formula to \(f(X_t)\), first stopping the solution when \(|X_t|\) reaches an integer \(m\). The stopped stochastic integral has expectation zero. With \(C=2L+L^2\), the bound just obtained implies \(E[f(X_{t\wedge\tau_m})]\leq C\int_0^t E[f(X_{s\wedge\tau_m})]\,ds\), because the integrand before stopping is bounded by \(C f(X_s)\), and \(f(X_s)\mathbf{1}_{s<\tau_m}\leq f(X_{s\wedge\tau_m})\). Since \(f(X_0)=0\), Grönwall's inequality gives \(E[f(X_{t\wedge\tau_m})]=0\). Letting \(m\) increase and using non-explosion shows \(X_t\geq0\) almost surely at each fixed \(t\). Taking the intersection of these probability-one events over nonnegative rational \(t\), and using continuity of the paths, gives nonnegativity for every \(t\geq0\). \(\square\)

Worked Example: A Model That Passes the Boundary Test

Consider \(dX_t=(0.4-0.7X_t)\,dt+0.3X_t\,dW_t\), with \(X_0=0.2\). The drift and diffusion are globally Lipschitz, since their slopes are \(-0.7\) and \(0.3\). At the boundary, \(b(0)=0.4\geq0\) and \(\sigma(0)=0\). The theorem therefore guarantees nonnegativity at every time, not merely at recorded times.

This conclusion can also be checked directly. Define \(G_t=\exp((-0.7-0.3^2/2)t+0.3W_t)\), which is strictly positive. The solution is \(X_t=G_t\left(0.2+0.4\int_0^tG_s^{-1}\,ds\right)\). Both \(G_t\) and the expression in parentheses are positive, so \(X_t>0\) for every \(t\). The boundary test and the explicit solution agree.

The boundary test is a model-level diagnostic: it asks what the specified continuous process does. It should not be replaced by checking only a batch of simulated grid values. A failing boundary test does not by itself calculate the frequency of negative values, but it signals that grid positivity cannot be treated as evidence of a valid nonnegative continuous model.

A Positive-Endpoint Path Can Still Cross Zero

For a concrete calculation, take \(dX_t=\sigma\,dW_t\) over an interval of length \(h\), with \(\sigma>0\), and condition on \(X_0=x>0\) and \(X_h=y>0\). The conditional path is a Brownian bridge between the endpoints. The reflection principle gives the probability that its minimum reaches or passes zero.

Result: For this constant-diffusion model, conditional on positive endpoints \(x\) and \(y\), \(P(\min_{0\leq t\leq h}X_t\leq0\mid X_0=x,X_h=y)=\exp(-2xy/(\sigma^2h))\).

To derive the formula, the transition density from \(x\) to \(y>0\) without a boundary is proportional to \(\exp(-(y-x)^2/(2\sigma^2h))\). The reflection principle says that paths which hit zero and then end at \(y\) correspond to reflected paths ending at \(-y\); their density is proportional to \(\exp(-(y+x)^2/(2\sigma^2h))\). Dividing this hit-zero density by the unrestricted endpoint density gives

$$ \frac{\exp(-(y+x)^2/(2\sigma^2h))} {\exp(-(y-x)^2/(2\sigma^2h))} =\exp\left(-\frac{(y+x)^2-(y-x)^2}{2\sigma^2h}\right) =\exp\left(-\frac{2xy}{\sigma^2h}\right). $$

This is the conditional probability of a crossing, so it is the ratio of the reflected density to the unrestricted density. In particular, the crossing probability is not the ratio itself but one minus that ratio only if calculating the probability of not crossing. Therefore the probability of a crossing is \(\exp(-2xy/(\sigma^2h))\); the no-crossing probability is \(1-\exp(-2xy/(\sigma^2h))\). Equivalently, the reflected density counts the paths that hit zero, while the difference between unrestricted and reflected densities counts paths that stay positive.

The density interpretation also resolves an easy-to-make sign error: the reflected-to-unrestricted ratio counts paths that hit the boundary. For positive endpoints, the crossing probability is that ratio, not its complement.

Worked Example: Positive Grid Endpoints With Substantial Crossing Risk

Suppose a simulated interval has length \(h=1\), constant diffusion \(\sigma=0.5\), and recorded endpoints \(x=y=0.2\). Both observations are positive, but the conditional crossing probability is

$$ \exp\left(-\frac{2(0.2)(0.2)}{(0.5)^2(1)}\right) =\exp(-0.32)\approx0.7261. $$

Thus, conditional on these endpoints, the model assigns about a 72.6% probability to a path that reaches zero or below in between. The positive recorded values do not make the interval safe. This SDE also fails the boundary diffusion test because its diffusion coefficient is \(0.5\), including at zero.

Targeted Refinement and Its Limits

When the Brownian-bridge calculation applies, it gives a direct way to decide which intervals deserve closer inspection. An interval with endpoints near zero, large diffusion, or long duration has a larger crossing probability. Refining those intervals first is more informative than uniformly adding output times without regard to boundary risk.

Worked Example: Choosing an Interval-Length Threshold

Suppose endpoints are both \(0.1\), diffusion is constant at \(\sigma=0.4\), and the interval length is \(h=0.25\). The conditional crossing probability is

$$ \exp\left(-\frac{2(0.1)(0.1)}{(0.4)^2(0.25)}\right) =\exp(-0.5)\approx0.6065. $$

To make this conditional probability at most 5%, require \(\exp(-2xy/(\sigma^2h))\leq0.05\). Taking logarithms and rearranging gives

$$ h\leq\frac{2xy}{\sigma^2\log(20)} =\frac{0.02}{0.16\log(20)} \approx0.0417. $$

An interval of length \(0.25\) therefore exceeds this risk-based threshold. Subdivision can focus attention on that interval, but the bound is conditional on the assumed constant-diffusion bridge model; it is not a universal certificate for a nonlinear SDE.

For state-dependent drift or diffusion, the displayed bridge probability is generally not exact. It may serve as a local approximation when the coefficients vary little over the interval, but that approximation should be checked against the model’s boundary behavior or a suitable hitting-probability calculation. In particular, a midpoint that is positive does not prove that the path stayed positive: a continuous path can cross and return between both the original endpoints and the midpoint.

Use the diagnostics together. Evaluate \(b(0)\) and \(\sigma(0)\) where the theorem’s assumptions apply; examine whether the model is defined below zero; and estimate crossing risk on intervals close to the boundary. If a model is theoretically nonnegative, investigate why a numerical procedure reports otherwise. If the model fails the boundary test, positive grid output does not repair that failure.

Common Mistakes and Alternatives

  • Treating positive endpoints as proof of a positive path. The bridge calculation gives a positive crossing probability even after conditioning on two positive endpoints. Check between-grid risk explicitly.
  • Using a bridge formula outside its assumptions. The exact expression above is for constant diffusion with Brownian bridge behavior. For nonlinear coefficients, label a local calculation as approximate or use a method justified for that model.
  • Clipping negative values to zero and calling the model valid. Clipping changes the simulated dynamics and distribution. It can hide a boundary violation rather than fix its cause.
  • Assuming more output points certify path validity. Refinement can detect more crossings, but finitely many observations cannot rule out crossings between them without an additional path or boundary argument.

The main alternatives serve different purposes. A boundary-invariant model gives a structural guarantee under stated assumptions. A hitting-probability or bridge calculation diagnoses risk between observations. Generic grid refinement improves temporal resolution but, on its own, is only a screening tool. Transforming the state or modifying the model may be appropriate when justified scientifically, but it must preserve the intended model rather than merely produce nonnegative numbers.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. For globally Lipschitz coefficients, what boundary conditions in the theorem guarantee nonnegativity from a nonnegative deterministic start?
  2. With \(x=y=0.1\), \(\sigma=0.4\), and \(h=0.25\), calculate the conditional bridge crossing probability.
  3. Why does observing positive values at both ends of an interval fail to establish continuous-path nonnegativity?
  4. Give one reason not to apply the exact bridge crossing formula unchanged to a nonlinear, state-dependent diffusion.

Solutions. (1) The conditions are \(\sigma(0)=0\) and \(b(0)\geq0\), in addition to the theorem’s global Lipschitz assumptions. (2) The probability is \(\exp[-2(0.1)(0.1)/((0.4)^2(0.25))]=\exp(-0.5)\approx0.6065\), or 60.7%. (3) A continuous path can reach zero or become negative between the endpoints and return to a positive value before the next observation; in the Brownian-bridge example, the conditional crossing probability is positive. (4) State-dependent coefficients generally change the conditional path law, so the constant-diffusion bridge formula need not be exact; use it only as a justified approximation or replace it with a model-appropriate hitting calculation.

Clinical Biostats