Tutorials › Population Pharmacokinetics › Serial Correlation In Within-Subject Residuals

Random-Effect Structure and Error Models · Tutorial 151 of 599

Serial Correlation In Within-Subject Residuals

Learn how serial correlation changes the conditional residual covariance of repeated concentrations, how to specify it, and how to assess whether it is a plausible alternative to independent errors.

Intermediate 11 min read

What You'll Learn

  • Define serial correlation in residuals conditional on subject effects and the pharmacokinetic model.
  • Specify AR(1) correlation for equally spaced observations and exponential correlation for irregular sampling times.
  • Construct the covariance matrix when residual variances differ across observations.
  • Calculate residual covariances and the variance of an average under serial correlation.
  • Distinguish residual correlation from shared random effects and recognize diagnostic warning signs.

Why Within-Subject Residual Correlation Matters

A pharmacokinetic model predicts a concentration for each observation, conditional on the subject’s covariates and random effects. Residuals are the differences between observed concentrations and those predictions. A common starting assumption is that residuals from different observations are conditionally independent. That assumption can be inadequate when nearby observations from the same subject tend to lie on the same side of the model prediction: an assay batch, a short-lived physiological fluctuation, or a local structural mismatch can make successive deviations related.

Serial correlation represents dependence among a subject’s residuals ordered over time, after conditioning on the model and the subject’s random effects. It is not a substitute for specifying the pharmacokinetic mean model, and it does not automatically explain why the residuals are related. Its role is to describe a pattern in their conditional covariance. This distinction matters because unmodelled serial dependence can make a model treat repeated evidence as more independent than it really is.

Definition: Let \(y_{ij}\) be the concentration for subject \(i\) at time \(t_{ij}\), and let \(f_{ij}(\eta_i)\) be the model prediction conditional on subject random effects \(\eta_i\). The residual is \(e_{ij}=y_{ij}-f_{ij}(\eta_i)\). A serial residual model specifies nonzero conditional covariance between \(e_{ij}\) and \(e_{ik}\) for observations from the same subject at different times, while typically assuming residual vectors are independent across subjects conditional on the model and random effects.

The qualifier conditional is essential. Even if residuals are conditionally independent, two concentrations from one subject can be associated marginally because they share random effects. Conversely, a serial residual covariance describes dependence that remains after conditioning on those effects. The earlier material on random effects and residual error provides the distinction between these sources of variation; here the focus is how to express the residual dependence itself.

Covariance Models for Repeated Concentrations

Suppose the conditional residual variance at observation \(j\) for subject \(i\) is \(\sigma_{ij}^{2}\). A general covariance specification is

$$ \operatorname{Cov}(e_{ij},e_{ik}\mid \eta_i)= \sigma_{ij}\sigma_{ik}R_{i,jk}, $$

where \(R_i\) is a correlation matrix: it is symmetric, has ones on the diagonal, and is positive semidefinite. In matrix notation, with \(D_i=\operatorname{diag}(\sigma_{i1},\ldots,\sigma_{in_i})\), the within-subject covariance matrix is \(\Sigma_i=D_iR_iD_i\). This form allows residual scale to vary with predicted concentration while expressing serial dependence separately through \(R_i\). For constant residual standard deviation \(\sigma\), it reduces to \(\Sigma_i=\sigma^2R_i\).

Definition: For equally spaced observations indexed in time order, a stationary AR(1) residual correlation model has \(R_{i,jk}=\rho^{|j-k|}\), where \(-1<\rho<1\). Thus adjacent observations have correlation \(\rho\), observations two steps apart have correlation \(\rho^2\), and so on. For irregular sampling times, a common continuous-time exponential model is \(R_{i,jk}=\exp[-\lambda|t_{ij}-t_{ik}|]\), with \(\lambda\geq 0\) measured in inverse units of time.

The AR(1) index is the observation order, not automatically elapsed time. It is most directly interpretable when observations are equally spaced. If gaps vary, using \(\rho^{|j-k|}\) makes correlation depend on the number of sampling steps rather than their actual duration. The exponential model instead uses elapsed time. For \(\lambda>0\), its correlation decreases as the time separation increases; at \(\lambda=0\), it is identically one for every separation, the limiting degenerate case rather than a decreasing-correlation model.

Both models assume a particular covariance pattern. The AR(1) form permits negative adjacent correlation when \(\rho<0\), with the sign alternating at successive lags. The exponential form has nonnegative correlation and a monotone decay when \(\lambda>0\). Neither form asserts that concentrations themselves follow an autoregression: the correlation applies to residuals after subtracting the pharmacokinetic predictions.

Why the AR(1) Covariance Has This Form

One way to justify the equally spaced AR(1) covariance is by a stationary Gaussian recursion. Let \(u_{ij}\) be independent standard normal innovations, and let the initial value \(z_{i1}\) be standard normal and independent of all innovations. For \(-1<\rho<1\), define

$$ z_{ij}=\rho z_{i,j-1}+\sqrt{1-\rho^2}\,u_{ij},\qquad j\geq 2. $$

The independence condition on the initial value is part of the construction. Since \(z_{i1}\) has mean zero and variance one, each subsequent value has mean zero and variance

$$ \operatorname{Var}(z_{ij})=\rho^2\operatorname{Var}(z_{i,j-1})+(1-\rho^2)\operatorname{Var}(u_{ij}) =\rho^2+(1-\rho^2)=1. $$

For \(k<j\), the innovation \(u_{ij}\) is independent of \(z_{ik}\), so the recursion gives \(\operatorname{Cov}(z_{ij},z_{ik})=\rho\operatorname{Cov}(z_{i,j-1},z_{ik})\). Applying this relation repeatedly yields \(\operatorname{Cov}(z_{ij},z_{ik})=\rho^{j-k}\). Because both variances are one, this is also the correlation. If the initial value were merely specified to have mean zero and variance one but not to be independent of the innovations, the covariance calculation would not follow; if it were not normal, the sequence would not generally be Gaussian. Those conditions should not be left implicit when using this recursive construction.

For irregular gaps, the exponential covariance has a related conditional transition representation. If adjacent times are separated by \(\Delta_{ij}=t_{ij}-t_{i,j-1}>0\), set \(a_{ij}=\exp(-\lambda\Delta_{ij})\), and use \(z_{ij}=a_{ij}z_{i,j-1}+\sqrt{1-a_{ij}^{2}}u_{ij}\), with a standard normal initial value independent of the independent standard normal innovations. This preserves unit variance. Multiplying the transition coefficients across intervening gaps gives correlation \(\exp[-\lambda(t_{ij}-t_{ik})]\) for \(j>k\).

Worked Example: AR(1) Covariance Across Four Samples

Consider four equally spaced hypothetical concentration samples from one subject. Suppose the conditional residual standard deviation is constant at \(2.0\ \text{mg/L}\), and the AR(1) correlation parameter is \(\rho=0.60\). The observations are equally spaced, so using lag order is appropriate under this model.

The correlation at lag one is \(0.60\), at lag two is \(0.60^2=0.36\), and at lag three is \(0.60^3=0.216\). Since each residual variance is \(2.0^2=4.0\ (\text{mg/L})^2\), covariance is four times correlation. Thus adjacent residual covariance is \(4.0(0.60)=2.40\ (\text{mg/L})^2\), and the lag-two covariance is \(4.0(0.36)=1.44\ (\text{mg/L})^2\).

The full conditional covariance matrix is

$$ \Sigma_i=4.0 \begin{pmatrix} 1&0.60&0.36&0.216\\ 0.60&1&0.60&0.36\\ 0.36&0.60&1&0.60\\ 0.216&0.36&0.60&1 \end{pmatrix} \quad (\text{mg/L})^2. $$

The diagonal entries remain \(4.0\ (\text{mg/L})^2\); serial correlation changes the off-diagonal entries, not the stipulated marginal residual variance. Under conditional independence, the same diagonal would be present but all off-diagonal entries would be zero.

Worked Example: Exponential Correlation at Unequal Time Gaps

Suppose three hypothetical samples are taken at 0, 2, and 5 hours, and the exponential model has \(\lambda=0.30\ \text{hour}^{-1}\). Assume the conditional residual standard deviation is \(1.5\ \text{mg/L}\) at all three times. The elapsed gaps are unequal, so correlations should use time differences rather than index lags.

For the first and second samples, the time difference is 2 hours, giving correlation \(\exp[-0.30(2)]=\exp(-0.60)=0.5488\). For the second and third, the gap is 3 hours, giving \(\exp(-0.90)=0.4066\). The first and third are 5 hours apart, giving \(\exp(-1.50)=0.2231\). The corresponding covariance matrix, in \((\text{mg/L})^2\), is

$$ \Sigma_i=2.25 \begin{pmatrix} 1&0.5488&0.2231\\ 0.5488&1&0.4066\\ 0.2231&0.4066&1 \end{pmatrix}. $$

For example, the covariance between the first and second residuals is \(2.25(0.5488)=1.235\ (\text{mg/L})^2\), while that between the first and third is \(2.25(0.2231)=0.5020\ (\text{mg/L})^2\). Since \(\lambda>0\), the correlation decreases with elapsed time. If instead \(\lambda=0\), all three correlations would equal one, not decrease.

Implications Compared With Independent Residuals

The uncorrelated-residual case is \(R_i=I\), the identity matrix. Under a conditionally multivariate normal residual model, this also implies conditional independence; otherwise, independence requires a separate assumption. Under a serial model, a run of positive residuals is less surprising than it would be under independence when \(\rho>0\) or when the exponential correlation is appreciable. The covariance also changes the joint contribution of a subject’s observations to the likelihood. Under a multivariate normal residual model, the conditional log-likelihood contribution, apart from constants, is

$$ -\frac{1}{2}\left\{\log|\Sigma_i|+ \mathbf{e}_i^\mathsf{T}\Sigma_i^{-1}\mathbf{e}_i\right\}, $$

where \(\mathbf{e}_i\) is the vector of that subject’s residuals. Independence uses a diagonal \(\Sigma_i\); serial correlation uses a structured non-diagonal matrix. It is therefore not generally correct to fit each observation as if it were independent and then adjust only a standard error afterward: the covariance structure changes how the joint residual pattern is evaluated.

Worked Example: Effect of Correlation on an Average Residual

For three hypothetical, equally precise residuals, suppose each has variance \(4.0\ (\text{mg/L})^2\) and adjacent AR(1) correlation \(\rho=0.50\). The average is \(\bar e=(e_1+e_2+e_3)/3\). Its variance equals the sum of all nine covariance terms divided by \(3^2\).

The diagonal covariance terms sum to \(3(4.0)=12.0\). The two adjacent pairs each contribute twice the covariance \(4.0(0.50)=2.0\), for a total of \(8.0\). The lag-two pair has correlation \(0.50^2=0.25\), covariance \(1.0\), and contributes twice, or \(2.0\). Therefore,

$$ \operatorname{Var}(\bar e)=\frac{12.0+8.0+2.0}{9} =\frac{22.0}{9}=2.444\ (\text{mg/L})^2. $$

If the residuals were conditionally independent with the same marginal variance, the average variance would be \(12.0/9=1.333\ (\text{mg/L})^2\). Positive serial correlation therefore increases uncertainty in this average: the three measurements contain less independent information about a shared level than the independence calculation suggests. This calculation concerns a simple average, not a general parameter standard error, which depends on the full model and covariance structure.

Assumptions, Diagnostics, and Limitations

A Gaussian serial residual model commonly assumes conditional mean zero, the specified covariance matrix, and multivariate normality of each subject’s residual vector conditional on its random effects and covariates. It also usually assumes residual vectors are independent across subjects. The covariance matrix must be valid and positive semidefinite; the AR(1) condition \(-1<\rho<1\) ensures the standard stationary model is nondegenerate, and the exponential form with \(\lambda\geq0\) is a valid covariance model. If residual scale depends on predicted concentration, the chosen \(\sigma_{ij}\) must also be appropriate; correlation modeling does not repair a misspecified variance function or mean model.

Diagnostics should examine residuals in time order within subjects, not only pooled residuals. Useful warning signs include long runs of residuals with the same sign, a residual autocorrelation pattern that persists after fitting the proposed covariance, and a fitted correlation estimate at or near a boundary. Check that the assumed sampling-time structure is sensible: a lag-one model can be misleading for highly irregular gaps, while a single exponential decay may fail if correlation does not decrease smoothly with time. Also inspect whether apparent residual runs are better explained by a systematic concentration-time misspecification or an omitted subject effect. A covariance model can absorb patterns statistically without identifying their biological source.

Serial correlation is most distinguishable when subjects contribute several appropriately timed observations, and when sampling schedules provide information across multiple time separations. With few observations per subject, the data may offer little information to separate correlation from residual scale or other model components. Replicate concentrations at the same time can help characterize residual variation, as discussed in the earlier material on replicate concentrations, but same-time replicates alone do not establish how correlation decays across time.

The principal alternative is conditionally independent residual error, which is simpler and may be adequate when residual dependence is negligible. A structured serial covariance is more economical than estimating an unrestricted covariance for every pair of sampling times, but its parsimony comes from assumptions such as constant lag decay or exponential time decay. Neither alternative should be selected merely because it produces a preferred result. Compare whether the covariance assumptions match the design, inspect conditional residual patterns, and evaluate model fit using methods appropriate to the fitted likelihood and model complexity. A serial residual model also does not automatically account for outliers or changing residual variance; those are distinct features requiring their own assessment.

Common pitfall: A researcher sees that consecutive concentrations from one subject are similar and concludes that residuals must be serially correlated. That similarity may instead arise from shared subject random effects or a misspecified concentration-time curve. The correction is to define residuals conditional on the structural model and random effects, then assess the remaining within-subject covariance pattern. Another error is to use \(\rho^{|j-k|}\) with irregular times while describing it as decay per hour; that formula decays per sampling step. Use a time-based covariance such as \(\exp[-\lambda|t_{ij}-t_{ik}|]\) when elapsed-time decay is intended.
Key takeaway: Serial residual correlation is a conditional covariance feature, distinct from random effects. Specify whether dependence follows observation lag or elapsed time, retain the marginal residual variances on the covariance diagonal, and verify that the assumed pattern is plausible for the sampling design and residual diagnostics.

Check Your Understanding

Answer each question, then compare with the concise solutions below.

  1. With equally spaced samples and \(\rho=-0.40\), what are the correlations at lags one, two, and three?
  2. For an exponential model with \(\lambda=0.20\ \text{hour}^{-1}\), what is the correlation between samples 4 hours apart?
  3. Why can concentrations from the same subject be marginally associated even if their residuals are conditionally independent?
  4. Three equally spaced residuals each have variance \(9\ (\text{mg/L})^2\), with AR(1) \(\rho=0\). What is the variance of their average?
  5. What is the main problem with interpreting \(\rho^{|j-k|}\) as an elapsed-time model when sampling intervals are unequal?

Solutions. (1) The correlations are \(-0.40\), \((-0.40)^2=0.160\), and \((-0.40)^3=-0.0640\). (2) \(\exp[-0.20(4)]=\exp(-0.80)=0.4493\). (3) Shared random effects can induce marginal association even when residuals are independent conditional on those effects. (4) With \(\rho=0\), the residuals are uncorrelated under this model, so \(\operatorname{Var}(\bar e)=9/3=3.00\ (\text{mg/L})^2\). (5) It makes correlation depend on the number of observation steps rather than the actual time gap, so equal index lags can represent different elapsed times.

Clinical Biostats