Why Feasibility Must Be Built Into Patient Generation
A virtual patient is a vector of mechanistic parameters, not a collection of unrelated draws. A parameter set can satisfy every individual range and still describe an impossible patient: a free and bound concentration may not sum to the stated total, for example, or a clearance may exceed a physiological limit determined by another patient trait. Enforcing linked constraints means constructing parameter vectors whose components are jointly feasible.
The key decision is whether to generate values that satisfy the constraints by construction, rather than generate unrestricted values and repair them afterward. Direct construction avoids invalid vectors, but it can also change marginal distributions and dependence. The generated population must therefore be checked not only for constraint violations but also for unintended changes in the intended patient variability.
Constraints may be equalities, such as conservation of a total; inequalities, such as positivity; or linked bounds, where the allowable range for one parameter depends on another. The intended parameter ranges, dependence structure, and physiological meanings established in the earlier material on defining admissible parameter ranges and encoding correlated patient traits remain important. A feasibility construction does not by itself guarantee that the resulting population matches all those targets.
Constructing Feasible Vectors Directly
Suppose a patient has two nonnegative components \(a\) and \(b\) whose sum is a total \(T\). Drawing all three independently and then hoping that \(a+b=T\) is not a viable method: exact equality has probability zero under continuous independent draws. Instead, generate the total and a proportion, then derive the components:
The equality \(a+b=T\) now holds identically. If the components have additional bounds, the proportion must be restricted accordingly. For example, if \(a_{\min}\leq a\leq a_{\max}\), then, for \(T>0\),
The allowed interval for \(f\) can itself depend on \(T\). It must also intersect the physical range \([0,1]\); if it does not, that value of \(T\) cannot yield a feasible patient.
A ratio can be handled similarly. To impose \(r_{\min}\leq a/b\leq r_{\max}\) for positive \(b\), generate \(b\) and a ratio \(r\) in the specified interval, then set \(a=rb\). If \(a\) has its own bounds, the allowed range of \(r\) must be further restricted to values compatible with those bounds and the generated \(b\). The order of generation therefore matters: bounds on a derived quantity may restrict the possible values of the quantities generated first.
Worked Example: Enforcing a Physiological Ratio
Consider hypothetical patient parameters \(x\) and \(y\), both measured in mg/L. Suppose \(1\leq y\leq 3\), \(2\leq x\leq 6\), and the required ratio satisfies \(1.5\leq x/y\leq 2.2\). For a proposed value of \(y\), the ratio constraint implies \(1.5y\leq x\leq 2.2y\). Combining this with the individual bounds gives
For \(y=1.6\) mg/L, the ratio-based interval for \(x\) is \(2.4\) to \(3.52\) mg/L. After intersecting with the individual range \(2\) to \(6\) mg/L, the feasible interval remains \(2.4\) to \(3.52\) mg/L. Choose \(r=1.8\) and construct \(x=ry\):
The generated \(x\) is within its individual range and the ratio is within its required range. If instead \(y=1.0\) mg/L, the ratio permits \(x\) from \(1.5\) to \(2.2\) mg/L, but the individual lower bound requires \(x\geq2\) mg/L. The feasible intersection is then \(2\) to \(2.2\) mg/L, not the full ratio-based interval. If the intersection were empty, that value of \(y\) would have to be excluded or the specified constraints reconsidered.
Linked Bounds and Conditional Construction
A parameter-dependent bound is often best represented as a conditional construction. Suppose a parameter \(k\) must satisfy \(0\leq k\leq b(z)\), where \(z\) is another patient trait and \(b(z)\) is a positive upper bound. Generate \(z\), then generate a unit-interval value \(u\), and set \(k=b(z)u\). For every \(u\in[0,1]\), this guarantees \(0\leq k\leq b(z)\).
This construction guarantees feasibility, but it also specifies a distributional choice. If \(u\) is uniform on \([0,1]\), then conditional on \(z\), \(k\) is uniform on \([0,b(z)]\). Its conditional mean is \(b(z)/2\), and its conditional variance is \(b(z)^2/12\). Therefore, even if \(u\) is generated independently of \(z\), \(k\) will generally depend on \(z\) through the bound. This is a mathematical consequence of the construction, not evidence that the model's physiological parameters have that particular conditional distribution.
More generally, if a conditional distribution for \(k\) is scientifically intended, use a transformation that has that conditional distribution while respecting the bound. The bound defines where \(k\) may occur; it does not determine how probability should be distributed within that range. The distinction is important when the intended patient population has specified marginal distributions or dependence, as discussed in the earlier material on copulas for non-Gaussian patient dependence.
Worked Example: A Bound That Depends on Another Trait
Suppose a hypothetical elimination parameter \(k\), in L/day, must satisfy \(0\leq k\leq 5/(1+0.5z)\), where \(z\) is a dimensionless patient trait with \(0\leq z\leq2\). Generate \(z=1\), then use \(u=0.60\) in the direct construction \(k=b(z)u\). At this value of \(z\), the bound is
Thus,
The construction satisfies \(0\leq2.000\leq3.333\) L/day. At \(z=2\), the upper bound would instead be \(5/(1+0.5(2))=2.500\) L/day. Using the same \(u=0.60\) would give \(k=1.500\) L/day. The changing upper bound means the distribution of \(k\) changes with \(z\), even though the same rule for \(u\) is used.
Derivation: Why a Bounded Transformation Changes the Density
The effect of a linked bound can be made explicit. Fix \(z\) and suppose \(u\) is uniform on \([0,1]\), with \(k=b(z)u\) and \(b(z)>0\). For a value \(k\) between zero and \(b(z)\), the event \(K\leq k\) is equivalent to \(U\leq k/b(z)\). Since \(U\) is uniform,
Differentiating this conditional cumulative distribution with respect to \(k\) gives the conditional density:
Thus the transformation is not distribution-neutral: it induces a uniform conditional distribution. If that distribution is not appropriate, replace the uniform \(u\) with a variable whose transformation gives the intended conditional distribution. For example, a desired conditional cumulative distribution \(F_{K\mid Z}(k\mid z)\) can be represented through its inverse, \(k=F^{-1}_{K\mid Z}(u\mid z)\), provided the distribution is defined on the feasible interval.
Worked Example: A Conserved Total With Component Bounds
Suppose two hypothetical concentrations \(a\) and \(b\), in mg/L, must sum to a patient-specific total \(T\). Let \(T=12\) mg/L and require \(3\leq a\leq5\) mg/L. The fraction \(f=a/T\) must therefore satisfy
Choose \(f=0.30\). Construct the components as
The conservation check is \(3.60+8.40=12.00\) mg/L, and \(a\) lies between 3 and 5 mg/L. The value of \(f\) was chosen from the interval implied by the bound; choosing \(f=0.50\), for instance, would preserve the total but violate the upper bound on \(a\). If \(T\) varied across patients, the feasible range for \(f\) would need to be recalculated for each generated total.
Assumptions, Diagnostics, and Common Failure Modes
A valid construction depends first on the constraints being correctly specified. Units must be compatible in sums and ratios; a ratio of quantities with different units must be interpreted with its resulting units. Bounds must apply to the same parameter definitions used in the model. If a constraint is only an empirical tendency rather than a physiological impossibility, enforcing it as an absolute rule may improperly remove plausible patients.
After generating a population, assess both feasibility and population behavior. A useful audit includes:
- Evaluate each equality residual, such as \(a+b-T\), and confirm it is zero up to the expected numerical tolerance.
- Check every inequality, including parameter-dependent bounds, for every generated patient.
- Count empty feasible intervals encountered during generation; these indicate incompatible constraints or an incompatible upstream draw.
- Inspect marginal distributions and pairwise dependence after transformation, not only the distributions of the values sampled before transformation.
- Look for excess probability near boundaries. A construction can produce boundary pileups if its input distribution or transformation concentrates values there.
- Repeat checks using the same units, parameter definitions, and numerical precision used by the QSP model.
A common mistake is to sample all parameters independently, then clip any out-of-range value to the nearest allowed boundary. For example, replacing an invalid \(k\) with its maximum \(b(z)\) guarantees the inequality, but it creates an artificial concentration of patients exactly at the bound and can change the marginal distribution and dependence. The correction is to construct \(k\) from a distribution defined on its feasible range, and then diagnose the resulting population. Another common mistake is to enforce one constraint while overlooking another: deriving \(a\) to satisfy \(a+b=T\) does not ensure that \(a\) also lies within its own bounds.
Direct parameterization is not the only possible approach. Projection onto a feasible set can be useful when a valid vector is already available, but the result depends on the chosen distance and may alter distributions or place many patients on a boundary. Clipping is simpler but has the boundary problem described above. Generating unrestricted vectors and retaining only feasible ones can be inefficient when feasibility is rare and may change the represented distribution. These alternatives do not remove the need to state the intended distribution and verify the final population.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions.
- A patient has components \(a\) and \(b\) with \(a+b=T\). Which quantity can be sampled and which can be derived to guarantee conservation?
- If \(0\leq k\leq b(z)\), with \(b(z)>0\), and \(u\) is uniform on \([0,1]\), what construction guarantees the bound? What is the conditional distribution of \(k\) given \(z\)?
- For \(y=2\) mg/L, \(2\leq x\leq6\) mg/L, and \(1.5\leq x/y\leq2.2\), find the feasible interval for \(x\).
- Why can clipping an out-of-range parameter to its bound distort a virtual population?
- What should be checked if a conservation construction satisfies the equality but produces a component outside its specified range?
Solutions. (1) Sample \(T\) and a feasible fraction \(f\), then set \(a=fT\) and \(b=(1-f)T\). (2) Set \(k=b(z)u\); conditional on \(z\), \(k\) is uniform on \([0,b(z)]\). (3) The ratio requires \(3\leq x\leq4.4\) mg/L, and intersecting with \(2\leq x\leq6\) gives \(3\) to \(4.4\) mg/L. (4) Clipping can put excess probability exactly at the bound and change marginal distributions and dependence. (5) Check that the fraction or other generated inputs were restricted to the interval implied by both conservation and the component bounds; satisfying the equality alone is insufficient.