Tutorials › Stochastic Differential Equations in Pharmacokinetics › Correlated Compartment Noise in Gaussian Transition Likelihoods

Likelihood for Discretely Observed Diffusions · Tutorial 58 of 100

Correlated Compartment Noise in Gaussian Transition Likelihoods

Learn to propagate correlated process noise through linear compartment dynamics and evaluate the resulting multivariate Gaussian transition likelihood.

Advanced 12 min read

What You'll Learn

  • Express correlated compartment noise through its diffusion covariance matrix.
  • Derive the transition mean and covariance over a finite observation interval.
  • Check when a transition covariance is positive definite and an ordinary density exists.
  • Calculate multivariate Gaussian transition densities and log-likelihood contributions.
  • Recognize errors caused by replacing propagated covariance with noise covariance times elapsed time.

Why the Transition Covariance Is Not Just the Noise Covariance

In a linear compartment diffusion, random perturbations enter continuously, while the compartment dynamics redistribute and attenuate them before the next observation. If two compartments receive correlated process noise, their transition errors are correlated; even uncorrelated noise can become correlated through the drift. A likelihood based on discretely observed states must therefore use the covariance accumulated over the whole interval, not just the instantaneous noise covariance.

The focus here is a linear diffusion with a known deterministic input and a constant drift and diffusion matrix over each observation interval. The exact transition density is Gaussian. The calculation below identifies its mean and covariance and shows how to use both in a likelihood. It assumes that the states themselves are observed without measurement error; adding an observation model is a separate step.

Definition: Let \(X(t)\in\mathbb{R}^d\) satisfy $$ dX(t)=[A X(t)+u(t)]\,dt+G\,dW(t), $$ where \(A\) is a constant \(d\times d\) matrix, \(u(t)\) is a deterministic integrable input, \(G\) is a constant \(d\times q\) matrix, and \(W(t)\) is a \(q\)-dimensional standard Brownian motion. The instantaneous process-noise covariance is \(Q=GG^{\mathsf T}\). Its off-diagonal entries encode correlations between the noise components entering the state coordinates. Write \(\Phi(h)=e^{Ah}\). For \(h>0\), conditional on \(X(t)=x\), the transition mean and covariance are $$ m(t,h;x)=\Phi(h)x+\int_0^h\Phi(h-s)u(t+s)\,ds,\qquad S(h)=\int_0^h\Phi(s)Q\Phi(s)^{\mathsf T}\,ds. $$

The same formulas apply interval by interval if known inputs or model coefficients change at specified times, by using the appropriate fundamental matrix and covariance integral on each interval. In what follows, \(A\) and \(G\) are constant across the interval being analyzed. The notation \(Q\) describes instantaneous covariance, whereas \(S(h)\) describes accumulated transition covariance. In general, \(S(h)\ne hQ\).

Deriving the Gaussian Transition

The variation-of-constants solution over an interval of length \(h\) is $$ X(t+h)=\Phi(h)X(t)+\int_0^h\Phi(h-s)u(t+s)\,ds+\int_0^h\Phi(h-s)G\,dW(t+s). $$

The first two terms are the conditional mean given \(X(t)\). The last term is a stochastic integral with deterministic integrand. It is Gaussian with mean zero, and its covariance follows from the Itô isometry for vector stochastic integrals. Changing variables from \(h-s\) to \(s\) gives exactly \(S(h)\). Thus the conditional transition law is \(N(m(t,h;x),S(h))\). The proof also shows why correlated noise must be propagated through \(\Phi\): the instantaneous covariance \(Q\) is transformed at every time between the noise entering and the endpoint.

Theorem: Under the conditions in the definition, for any fixed \(t\) and \(h>0\), conditional on \(X(t)=x\), $$ X(t+h)\mid X(t)=x\sim N\!\left(m(t,h;x),S(h)\right). $$ If \(S(h)\) is positive definite, this law has the ordinary \(d\)-variate Gaussian density $$ p_h(y\mid x)=\frac{1}{(2\pi)^{d/2}|S(h)|^{1/2}} \exp\!\left[-\frac{1}{2}\{y-m(t,h;x)\}^{\mathsf T}S(h)^{-1}\{y-m(t,h;x)\}\right]. $$

Here is the covariance derivation in full. Define the stochastic integral in the solution by \(Z\). Since its integrand is deterministic, \(E[Z\mid X(t)=x]=0\). The increments of \(W\) after time \(t\) are independent of the information up to \(t\), so conditioning on \(X(t)=x\) does not change their covariance. The Itô isometry gives $$ \operatorname{Cov}(Z\mid X(t)=x)=\int_0^h\Phi(h-s)GG^{\mathsf T}\Phi(h-s)^{\mathsf T}\,ds =\int_0^h\Phi(r)Q\Phi(r)^{\mathsf T}\,dr=S(h), $$ where \(r=h-s\). Deterministic-integrand Brownian integrals are Gaussian: approximating the integral by sums gives Gaussian random vectors, and the sums converge in mean square to the integral, yielding the stated Gaussian law. The displayed density is the multivariate normal density when its covariance is positive definite. \(\square\)

The covariance is always positive semidefinite, because for every vector \(v\), $$ v^{\mathsf T}S(h)v=\int_0^h\left|G^{\mathsf T}\Phi(r)^{\mathsf T}v\right|^2\,dr\ge 0. $$ It is positive definite exactly when this integral is strictly positive for every nonzero \(v\). In particular, a full-rank \(Q\) is sufficient for \(h>0\). When \(S(h)\) is singular, the transition is Gaussian but supported on a lower-dimensional set; the ordinary density formula using \(S(h)^{-1}\) does not apply.

Worked Covariance Calculations

Worked Example: Two Compartments With Correlated Noise

Suppose the drift attenuates the two compartments separately, with \(A=\operatorname{diag}(-1,-2)\), and the instantaneous covariance is $$ Q=\begin{pmatrix}1&0.5\\0.5&1\end{pmatrix}. $$ Compute the transition covariance after one time unit.

The matrix exponential is \(\Phi(s)=\operatorname{diag}(e^{-s},e^{-2s})\). Substitution into the covariance integral gives $$ S(1)=\begin{pmatrix} \int_0^1 e^{-2s}\,ds & 0.5\int_0^1 e^{-3s}\,ds\\ 0.5\int_0^1 e^{-3s}\,ds & \int_0^1 e^{-4s}\,ds \end{pmatrix} =\begin{pmatrix} (1-e^{-2})/2 & (1-e^{-3})/6\\ (1-e^{-3})/6 & (1-e^{-4})/4 \end{pmatrix}. $$

Numerically, \(S(1)\approx\begin{pmatrix}0.4323&0.1583\\0.1583&0.2454\end{pmatrix}\). Its determinant is approximately \(0.4323(0.2454)-(0.1583)^2=0.0810>0\), so it is positive definite. The off-diagonal covariance is not \(0.5\), the instantaneous covariance: attenuation over the interval changes its magnitude. Ignoring the initial correlation would incorrectly set this entry to zero.

Worked Example: Exchange Drift and a Correlated Noise Matrix

Take \(A=\begin{pmatrix}-2&1\\1&-2\end{pmatrix}\), \(Q=\begin{pmatrix}1&0.4\\0.4&1\end{pmatrix}\), \(u(t)=0\), and an interval of length \(h=0.5\). Find the transition covariance and mean from \(x=(1,0)^{\mathsf T}\).

The normalized eigenvectors are \(v_+=(1,1)^{\mathsf T}/\sqrt{2}\) and \(v_-=(1,-1)^{\mathsf T}/\sqrt{2}\). Their eigenvalues under \(A\) are \(-1\) and \(-3\); under \(Q\), they are \(1.4\) and \(0.6\). In these shared directions, the covariance integral reduces to scalar integrals. The two eigenvalues of \(S(0.5)\) are $$ s_+=1.4\int_0^{0.5}e^{-2r}\,dr=0.7(1-e^{-1})\approx0.44248,\qquad s_-=0.6\int_0^{0.5}e^{-6r}\,dr=0.1(1-e^{-3})\approx0.09502. $$

Transforming back to the compartment coordinates, $$ S(0.5)=\begin{pmatrix}(s_++s_-)/2&(s_+-s_-)/2\\(s_+-s_-)/2&(s_++s_-)/2\end{pmatrix} \approx\begin{pmatrix}0.26875&0.17373\\0.17373&0.26875\end{pmatrix}. $$

The mean transition matrix has eigenvalues \(e^{-0.5}\) and \(e^{-1.5}\) in the two directions. Thus \(\Phi(0.5)\approx\begin{pmatrix}0.41483&0.19170\\0.19170&0.41483\end{pmatrix}\), and \(m=\Phi(0.5)x\approx(0.41483,0.19170)^{\mathsf T}\). The positive off-diagonal element of \(S\) reflects both the correlated input noise and the exchange drift.

Using the Transition in a Likelihood

Suppose the full state vectors \(x_0,\ldots,x_n\) are observed at times \(t_0<\cdots<t_n\). Let \(h_i=t_i-t_{i-1}\), and suppose the model parameters are constant over each interval (with any known deterministic input included in its interval mean). Brownian increments on disjoint intervals are independent. Therefore, conditional on the starting state, the joint transition likelihood is the product of the corresponding Gaussian densities.

Theorem: If every interval covariance \(S_i=S(h_i)\) is positive definite, the conditional log-likelihood for fully observed states is $$ \ell(\theta)=-\frac{1}{2}\sum_{i=1}^n\left[d\log(2\pi)+\log|S_i|+ r_i^{\mathsf T}S_i^{-1}r_i\right], \qquad r_i=x_i-m(t_{i-1},h_i;x_{i-1}), $$ where any parameters in \(A\), \(G\), or \(u\) are collected in \(\theta\).

To justify the expression, condition successively on the states already observed. Independent future Brownian increments imply that the conditional density of \(x_i\), given the observed history through \(x_{i-1}\), is \(p_{h_i}(x_i\mid x_{i-1})\). The joint conditional density is therefore \(\prod_{i=1}^n p_{h_i}(x_i\mid x_{i-1})\). Taking logarithms turns this product into a sum. Substituting the Gaussian density gives a normalization term \(d\log(2\pi)\), a covariance-volume term \(\log|S_i|\), and a squared standardized residual term \(r_i^{\mathsf T}S_i^{-1}r_i\) for each interval. \(\square\)

Worked Example: Evaluating a Correlated Gaussian Transition Density

Use the model and \(h=0.5\) covariance from the preceding example. Suppose \(x_0=(1,0)^{\mathsf T}\), and the observed next state is the mean plus one standard deviation in the \(v_+\) direction. Compute its transition log-density.

The mean is \(m\approx(0.41483,0.19170)^{\mathsf T}\). Since the covariance eigenvalue in direction \(v_+\) is \(s_+\approx0.44248\), the residual is \(r=\sqrt{s_+}v_+\approx(0.47037,0.47037)^{\mathsf T}\). Its quadratic form is \(r^{\mathsf T}S^{-1}r=1\), because \(r\) is a one-standard-deviation displacement in an eigenvector direction.

The determinant is \(s_+s_-\approx0.44248(0.09502)=0.04205\). Hence $$ \ell_{\text{transition}}=-\log(2\pi)-\frac12\log(0.04205)-\frac12(1)\approx-0.753. $$

Equivalently, the density is approximately \(e^{-0.753}=0.471\). The determinant term matters: omitting it would reward parameter values that inflate the covariance without accounting for the resulting spread of probability mass.

Diagnostics, Alternatives, and Limitations

A practical diagnostic is to check each computed covariance for symmetry and positive definiteness. Symmetry follows from the integral formula; small numerical asymmetry can be removed by replacing a computed matrix with \((S+S^{\mathsf T})/2\), but substantial asymmetry signals an implementation error. Cholesky factorization is a useful positive-definiteness check. If it fails, investigate parameter values, integration accuracy, and whether the model truly yields a full-dimensional transition. Do not silently add a large diagonal “jitter”: that changes the likelihood.

For stable computation, evaluate the quadratic form by solving \(S_i z=r_i\) and using \(r_i^{\mathsf T}z\), rather than explicitly forming \(S_i^{-1}\). Use a Cholesky factor to compute the log-determinant. For constant \(A\) and \(Q\), the covariance also satisfies the differential equation \(\dot S=AS+SA^{\mathsf T}+Q\), \(S(0)=0\); this provides an alternative numerical route and a check against the integral.

The main alternatives are to calculate the covariance integral directly, solve this matrix differential equation, or use a block matrix exponential for constant coefficients. Each should agree up to numerical tolerance. Replacing \(S(h)\) with \(hQ\) is only a short-interval approximation when drift has negligible effect over \(h\); it is not the exact transition covariance. Likewise, treating correlated process-noise components as independent discards off-diagonal entries of \(Q\) and generally changes both the residual quadratic form and the determinant.

The exact Gaussian likelihood requires linear drift and additive Gaussian noise over the interval, with deterministic coefficients as specified. State-dependent diffusion or nonlinear drift generally does not have this Gaussian transition density. If the covariance is singular, the ordinary density likelihood above is unavailable and the support of the degenerate transition must be handled explicitly. These formulas also concern latent state transitions, not noisy concentration measurements.

Common Mistake

  • Wrong reasoning: “The noise covariance is \(Q\), so over an interval of length \(h\), the transition covariance is \(hQ\).” This ignores the drift acting on disturbances after they enter the system.
  • Correction: Propagate each disturbance to the interval endpoint with \(\Phi\), then accumulate its covariance: \(S(h)=\int_0^h\Phi(s)Q\Phi(s)^{\mathsf T}\,ds\). The shortcut \(hQ\) is generally inaccurate unless the drift effect is negligible on the interval.
Key takeaway: Correlated process noise enters a Gaussian transition likelihood through \(Q\), but the covariance used in the density is the propagated covariance \(S(h)\). Use that full matrix in both the determinant and the residual quadratic form.

Check Your Understanding

Try these questions, then check the solutions.

  1. For a scalar process with \(A=-k\), \(k>0\), and instantaneous variance \(Q=q\), derive \(S(h)\).
  2. What condition on \(S(h)\) is needed for the ordinary Gaussian density formula involving \(S(h)^{-1}\)?
  3. Why can drift create a nonzero transition covariance between coordinates even when \(Q\) is diagonal?
  4. For fully observed states, which three terms contribute to each Gaussian transition log-likelihood contribution?

Solutions. (1) \(S(h)=\int_0^h e^{-2ks}q\,ds=q(1-e^{-2kh})/(2k)\). (2) \(S(h)\) must be positive definite; positive semidefiniteness alone does not ensure an inverse or an ordinary full-dimensional density. (3) The matrix \(\Phi(s)\) can mix coordinates, so \(\Phi(s)Q\Phi(s)^{\mathsf T}\) can have off-diagonal entries even if \(Q\) does not. (4) The normalization \(d\log(2\pi)\), the log-determinant \(\log|S_i|\), and the residual quadratic form \(r_i^{\mathsf T}S_i^{-1}r_i\), each multiplied by \(-1/2\).

Clinical Biostats