Marginal Fit Is Not Joint Fit
A virtual patient is a coherent set of traits and parameters, not a list of separately plausible values. A generated population can reproduce the distribution of each trait and still combine those traits in ways that are rare, inconsistent, or absent in the target population. In a mechanistic model, such combinations can matter because parameters jointly determine trajectories and responses.
The distinction is between matching each trait on its own and matching how traits occur together. For example, a population may match the distributions of a disease-burden measure and a pathway-marker measure, yet lose the tendency for patients with higher burden to have higher marker values. That loss can alter which kinds of patients the virtual population represents and how model outputs are distributed.
This tutorial focuses on continuous traits and dependence between them. The earlier material on encoding correlated patient traits and copulas provides ways to represent dependence; here the focus is what can go wrong when marginal matching is done separately. Matching marginals may involve assigning values from separate lists, independently resampling traits, or applying separate matching steps that do not preserve each patient's full vector.
Why Separate Matching Changes Pairings
Suppose a target population contains paired observations \((x_i,y_i)\), where \(x_i\) and \(y_i\) are two traits measured on the same patients. If an algorithm keeps the \(x_i\) values and the \(y_i\) values but reassigns the \(y\) values independently of \(x\), the two marginal lists remain unchanged. The patient-level pairings, however, have changed.
If traits are independently drawn from their target marginals, the resulting joint distribution is the product of those marginals. That is a specific dependence assumption: independence. It is not a neutral way of matching the marginals. If the target traits are associated, independent pairing removes that association in the ideal population distribution.
Here \(f_X\) and \(f_Y\) denote marginal densities when the traits are continuous. For discrete traits, the same statement uses probability mass functions. When the traits have finite variances, independence implies \(\operatorname{Cov}(X,Y)=0\). The converse is not generally true: zero covariance does not establish independence.
A Short Justification: Random Re-pairing Erases Linear Association on Average
The finite-sample version makes the mechanism concrete. Keep fixed trait values \(x_1,\ldots,x_n\) and \(y_1,\ldots,y_n\), and randomly permute the \(y\) values before pairing them with the \(x\) values. Let \(\bar{x}\) and \(\bar{y}\) be the means of these two lists. The covariance calculated from one re-pairing is
where \(\pi\) is the random permutation. Each centered \(y\) value is equally likely to be assigned to any position, so for every \(i\),
Taking expectations term by term gives \(E[C_\pi]=0\). Thus random re-pairing preserves the two lists but has zero covariance on average. A particular finite permutation need not have exactly zero covariance, and a nonlinear dependence pattern can remain even when covariance is zero. The argument shows why re-pairing is not a method for preserving the target dependence.
Worked Example: Perfect Association Lost Despite Exact Marginals
Consider four hypothetical patients with a standardized burden trait \(X\) and a pathway-marker trait \(Y\), recorded in arbitrary units. The target pairs are \((0,0),(0,0),(1,1),(1,1)\). Independently matching the same two marginal lists could produce the pairs \((0,0),(0,1),(1,0),(1,1)\). Compare the two populations.
Target marginals. In both populations, the \(X\) values are \(0,0,1,1\), and the \(Y\) values are \(0,0,1,1\). Each trait therefore has mean \(0.5\) and variance \(\{(0-0.5)^2+(0-0.5)^2+(1-0.5)^2+(1-0.5)^2\}/4=0.25\).
Target dependence. For the target pairs, the mean of the four \(XY\) products is \((0+0+1+1)/4=0.5\). The covariance is \(0.5-(0.5)(0.5)=0.25\), so the correlation is \(0.25/\sqrt{0.25(0.25)}=1\). In this target set, the two traits rise together exactly.
After independent pairing. The four \(XY\) products are \(0,0,0,1\), with mean \(0.25\). The covariance is \(0.25-(0.5)(0.5)=0\), and the correlation is \(0/\sqrt{0.25(0.25)}=0\). The two marginals still match exactly, but the association has disappeared. In this hypothetical example, the new combinations include high burden with a low marker and low burden with a high marker, unlike the target pairs.
This comparison does not establish that such combinations are biologically impossible. It shows that marginal summaries alone cannot tell whether the combinations are representative. That judgment requires joint target information and mechanistic or clinical context.
Correlation Is Useful but Not a Complete Diagnosis
Pearson correlation summarizes linear association. It can reveal an important change when a target population has a strong increasing or decreasing linear pattern, but it cannot describe every feature of the joint distribution. In particular, a correlation near zero can occur when traits have a clear nonlinear relationship. Conditional summaries can expose structure that a single correlation hides.
Worked Example: A Zero Correlation Can Hide a Changed Pattern
Suppose three hypothetical patients have burden values \(X=-1,0,1\). In the target, the paired marker values are \(Y=1,0,1\); after re-pairing, they are \(Y=0,1,0\). The \(X\) list is unchanged, and both \(Y\) lists contain two zeros and one one. Thus the marginal distributions match exactly.
Target covariance and correlation. The means are \(\bar{x}=0\) and \(\bar{y}=2/3\). The mean of the \(XY\) products is \(\{(-1)(1)+(0)(0)+(1)(1)\}/3=0\). Therefore the covariance, using divisor \(3\), is \(0-(0)(2/3)=0\), and Pearson correlation is zero because both traits have nonzero variance.
Re-paired covariance and correlation. The mean of the products is \(\{(-1)(0)+(0)(1)+(1)(0)\}/3=0\). The means and marginal variances are unchanged, so covariance and correlation are again zero.
Conditional pattern. In the target, \(Y=1\) at both \(X=-1\) and \(X=1\), while \(Y=0\) at \(X=0\). After re-pairing, the marker is \(1\) at \(X=0\) and \(0\) at \(X=-1\) and \(X=1\). The same marginals and the same zero correlation conceal a substantial change in how marker values depend on burden. A scatterplot or summaries of \(Y\) across values or ranges of \(X\) reveal this difference.
For this reason, diagnose joint fit using more than one statistic. When paired target data are available, inspect plots of paired traits and compare conditional patterns relevant to the application. A conditional distribution describes one trait among patients with specified values or ranges of another trait. The appropriate summaries depend on the traits: conditional means may help for continuous outcomes, while spread and tail behavior can also matter. These checks complement, rather than replace, mechanistic review of whether generated combinations are plausible.
Worked Diagnosis in a Parameter-Generation Workflow
Worked Example: Identifying a Re-pairing Warning
A hypothetical QSP workflow generates 100 virtual patients with two parameters: receptor abundance \(R\) and a pathway activation coefficient \(A\). The analyst separately matches the target list of 100 \(R\) values and the target list of 100 \(A\) values, then assigns the two lists to patients independently. The target paired data have correlation \(0.70\); the generated population has correlation \(0.03\). Assume both values were calculated from the same trait definitions and the same patient records.
The marginals are matched by construction, but the dependence diagnostic changes from a substantial positive linear association to a near-zero one. This is a warning that independent assignment has not preserved the target joint structure. It is not, by itself, proof that every generated patient is implausible: correlation summarizes linear association and does not describe all possible pairings.
The next check is to compare paired scatterplots and conditional summaries of \(A\) across ranges of \(R\), using the target pairs and generated pairs. The analyst should also run the mechanistic model on the generated combinations and inspect whether the combinations produce response patterns inconsistent with the intended population. If the target dependence is supported by suitable paired data, a defensible remedy is to use a generation or selection procedure that preserves whole parameter vectors, or to represent the dependence explicitly. The earlier material on copulas gives one framework for encoding dependence while retaining chosen marginals.
Diagnostics, Alternatives, and Limitations
A practical diagnosis begins by confirming that the traits have the same definitions, scales, and target population in both comparisons. An apparent change can otherwise reflect different preprocessing or populations rather than re-pairing. Then examine whether marginal fit and joint structure have been assessed separately.
- Check pair identity. Determine whether traits remain attached to the same target patients or have been independently sampled, sorted, or assigned.
- Inspect paired plots. Compare target and generated scatterplots for trends, clusters, curvature, and gaps. A plot can reveal patterns not summarized by a single correlation.
- Compare dependence summaries. Correlation is useful for linear association; rank-based summaries can help identify monotone association. Neither alone establishes that the full joint distributions match.
- Check conditional behavior. Compare one trait across meaningful ranges of another, especially where the QSP model is sensitive to the combination.
- Review mechanistic consequences. Evaluate whether generated combinations remain within the intended physiological and model-supported region. Plausibility is not determined by statistical association alone.
There are several alternatives to independent marginal matching. Selecting or resampling complete candidate patient vectors retains their existing pairings, although the resulting population may not meet every target. Weighting complete vectors can alter which patients are represented without splitting their traits apart; the earlier material on weighted resampling and optimization-based selection addresses such approaches. Explicit dependence models, including copulas, can represent a target association while allowing chosen marginal forms. Each approach depends on the quality of candidate data and the adequacy of the assumed joint structure.
No diagnostic can recover dependence information that was never observed or specified. Pairwise correlations also do not uniquely determine a multivariate joint distribution, and estimates from small or unrepresentative target samples may be uncertain. A generated population may need to balance marginal targets, dependence information, feasibility constraints, and model behavior. The key is to state which joint features are supported and assess whether the chosen generation method preserves them; matching marginals alone is not evidence that it does.
Common Pitfall
Check Your Understanding
Answer each question using the definitions and diagnostics in this tutorial.
- If two generated traits each match their target marginal distributions, what additional information is needed to conclude that their joint structure is preserved?
- What does independently drawing traits from their marginals assume about their joint distribution?
- Why can Pearson correlation fail to identify a changed relationship between two traits?
- A target population has positive trait correlation, but independently re-paired generated values have correlation near zero. What should be checked next?
Solutions. (1) Information about how the traits co-occur, such as paired observations, dependence summaries, and relevant conditional patterns, is needed; marginal agreement is insufficient. (2) It assumes independence, so the joint distribution is the product of the marginals. (3) Correlation measures linear association; nonlinear dependence can have zero correlation, and distinct joint patterns can share the same correlation. (4) Confirm consistent trait definitions and population, compare paired plots and conditional summaries, and assess the generated combinations in model context. If the target association is credible, consider a method that preserves or explicitly models dependence.