Tutorials › Quantitative Systems Pharmacology (QSP) › Sequential Constraint Filtering For Multiple Targets

Virtual Patient Generation · Tutorial 708 of 799

Sequential Constraint Filtering For Multiple Targets

Track what each distributional constraint retains, how it changes subgroup composition, and which parts of parameter space remain represented.

Advanced 12 min read

What You'll Learn

  • Define sequential constraints as nested subsets of a fixed candidate pool
  • Calculate per-step conditional and cumulative acceptance rates, including zero-count cases
  • Compare subgroup representation before and after filtering
  • Track occupancy across prespecified parameter-space regions
  • Diagnose restrictive or imbalanced filters and compare sequential filtering with alternatives

Why Track Constraints One Step at a Time?

A virtual population may need to satisfy several distributional requirements at once. For example, candidates might need to fall within acceptable ranges for a model output, reproduce a phenotype prevalence, and retain adequate representation across parameter regions. Applying every requirement as one final pass/fail rule gives an overall retained set, but does not reveal which requirement removed most candidates or whether the successive losses disproportionately affected a subgroup.

Sequential constraint filtering makes that attrition visible. It records the candidates remaining after each criterion, allowing the analyst to distinguish a constraint that is broadly permissive from one that sharply narrows the pool. The goal is not merely to maximize the number retained: the final set must also preserve the subgroup representation and parameter-space coverage needed for its intended use.

Definition: Let \(N_0\) be the number of candidates in a fixed starting pool. At step \(j\), apply a prespecified constraint to the candidates that passed all earlier steps, and let \(N_j\) be the number remaining. The accepted sets are nested, so \(N_0 \geq N_1 \geq \cdots \geq N_j\). The step-specific conditional acceptance rate is \(N_j/N_{j-1}\), defined only when \(N_{j-1}>0\). The cumulative acceptance rate through step \(j\) is \(N_j/N_0\), defined when \(N_0>0\).

These rates answer different questions. The conditional rate describes the fraction of candidates reaching step \(j\) that pass that step; the cumulative rate describes the fraction of the original pool that has survived through step \(j\). The rates can differ: if \(N_{j-1}<N_0\) and \(N_j>0\), the conditional rate is larger than the cumulative rate. If \(N_j=0\), both rates are zero, provided their denominators are positive. If a step leaves no candidates, later conditional rates are undefined, not zero: there are no candidates on which to calculate them.

Formalizing the Filters

Represent candidate \(i\) by its parameter vector and any derived quantities used in the constraints. For a fixed pool of \(N_0\) candidates, let \(I_{ij}=1\) if candidate \(i\) passes constraint \(j\), and \(I_{ij}=0\) otherwise. A candidate survives through step \(j\) only if it passes every constraint up to and including \(j\). Thus the count after step \(j\) is the sum of these cumulative pass indicators.

$$ N_j=\sum_{i=1}^{N_0}\prod_{k=1}^{j} I_{ik}. $$

This construction assumes a fixed candidate pool, fixed definitions of the constraints, and consistent candidate identities across steps. Each filter is a deterministic pass/fail rule for the recorded candidate values. If a required value is missing, the handling rule must be specified before filtering; silently treating missing values as either passes or failures changes the effective constraint. Counts describe this pool, not automatically a probability in a larger population.

When all denominators in the following product are positive, the cumulative rate factors into the conditional rates. Specifically, for \(N_0>0\) and \(N_{k-1}>0\) for every \(k=1,\ldots,j\), cancellation of consecutive counts gives:

$$ \frac{N_j}{N_0} = \prod_{k=1}^{j}\frac{N_k}{N_{k-1}}. $$

If a step leaves zero candidates, the cumulative rate at that step is zero. Every later count is also zero because accepted sets are nested, but the conditional rate at any later step has a zero denominator and is undefined. The product identity must not be extended through such a step by writing a factor \(0/0\).

Worked Example: Finding the Constraint Responsible for Attrition

A hypothetical pool of 1,000 QSP parameter candidates is filtered in sequence. The criteria concern a simulated biomarker summary, phenotype prevalence, and a second model-output summary. The observed counts are \(N_0=1{,}000\), \(N_1=700\), \(N_2=350\), \(N_3=210\), and \(N_4=84\). Calculate the conditional and cumulative acceptance rates.

At step 1, the conditional rate is \(700/1{,}000=0.700\), or 70.0%; the cumulative rate is also \(700/1{,}000=0.700\).

At step 2, the conditional rate is \(350/700=0.500\), or 50.0%, while the cumulative rate is \(350/1{,}000=0.350\), or 35.0%.

At step 3, the conditional rate is \(210/350=0.600\), or 60.0%, and the cumulative rate is \(210/1{,}000=0.210\), or 21.0%. At step 4, the conditional rate is \(84/210=0.400\), or 40.0%, and the cumulative rate is \(84/1{,}000=0.084\), or 8.4%.

The product check is \(0.700 \times 0.500 \times 0.600 \times 0.400=0.084\), matching \(84/1{,}000\). The second criterion has the lowest conditional retention here. This identifies where attrition is greatest in this sequence; it does not establish that the criterion is inappropriate, since its scientific purpose and the adequacy of the resulting population also matter.

Subgroup Representation Through the Sequence

Overall counts can conceal unequal filtering across subgroups. For a subgroup \(g\), track both its count \(N_{j,g}\) after each step and its representation \(N_{j,g}/N_j\) among the remaining candidates when \(N_j>0\). Also compare the subgroup-specific pass rate \(N_{j,g}/N_{j-1,g}\), which is defined only if \(N_{j-1,g}>0\). A change in representation is descriptive of this candidate pool; it is not, by itself, evidence of a causal effect.

Worked Example: Detecting a Change in Subgroup Composition

A hypothetical pool contains 600 candidates: 240 in subgroup A and 360 in subgroup B. After the first filter, 180 A and 252 B candidates remain. After the second, 90 A and 180 B remain. After the third, 54 A and 126 B remain. Calculate subgroup-specific pass rates and compare the final composition with the starting composition.

At the first step, subgroup A retains \(180/240=0.750\), or 75.0%, and subgroup B retains \(252/360=0.700\), or 70.0%. The total is \(180+252=432\), so A represents \(180/432=41.67\%\) of the remaining candidates, compared with \(240/600=40.0\%\) initially.

At the second step, A retains \(90/180=0.500\), or 50.0%, and B retains \(180/252=0.7143\), or 71.43%. The total is 270, of which A is \(90/270=33.33\%\).

At the third step, A retains \(54/90=0.600\), or 60.0%, and B retains \(126/180=0.700\), or 70.0%. The final total is 180, and A represents \(54/180=30.0\%\). Thus A's share has fallen from 40.0% to 30.0% in the selected pool. Reporting only the overall final count would miss this shift, which may matter if both subgroups are important to the virtual population's intended use.

Parameter-Space Coverage

Coverage can also be tracked across prespecified regions of parameter space. For a small set of scientifically meaningful regions or bins, tabulate how many candidates occupy each region before filtering and after every step. This shows whether a filter leaves some regions sparsely represented or empty. The bins should be defined before examining the filtering results when possible; changing their boundaries after seeing the retained pool can make apparent coverage difficult to interpret.

Worked Example: Tracking Representation Across Parameter Regions

Suppose a hypothetical pool of 500 candidates is divided in advance into four regions of a two-parameter space. Their starting counts are 120, 140, 130, and 110. After the first constraint, the counts are 36, 56, 13, and 11; after the second, they are 18, 28, 3, and 1. Check the totals and describe the coverage.

The first-stage total is \(36+56+13+11=116\), so overall cumulative acceptance is \(116/500=0.232\), or 23.2%. The second-stage total is \(18+28+3+1=50\), giving \(50/116=0.4310\), or 43.10%, conditional acceptance at that step, and \(50/500=0.100\), or 10.0%, cumulative acceptance.

All four regions remain represented, but the fourth has only one candidate and the third has only three. Consequently, the final pool has weak empirical representation in those regions despite nonzero counts. This table does not prove that the unrepresented portions of parameter space are impossible; it reports what this finite candidate pool covers after the stated filters.

Choosing and Ordering the Constraints

For fixed pass/fail criteria applied to the same candidates, the final set is the intersection of the criteria: a candidate survives exactly when it passes all of them. The order of applying those criteria does not change that intersection. However, order does change the intermediate counts and the conditional pass rates, so it changes which constraint appears most restrictive at each step. If later criteria are adaptively redefined using the candidates that remain, then changing order can change the criteria themselves and therefore the final set; that is no longer simply a reordering of fixed filters.

A useful operational sequence is to apply clear, inexpensive, and scientifically necessary checks early, then record the more computationally intensive distributional checks. This can reduce wasted computation, but it should not be used to hide the impact of a later filter. Keep the definition of each constraint, its order, counts, and subgroup or region tallies so the filtering path is reproducible.

Sequential filtering is not the only way to select a population. Rejection sampling against target ranges also retains or rejects candidates, but a staged count table makes attrition at each criterion explicit. Weighted resampling can retain candidates with unequal multiplicities or weights rather than imposing a sequence of hard pass/fail cutoffs. Optimization-based selection can seek a set that balances several matching criteria, but it answers a different selection problem and does not make the hard-filter counts equivalent to weights or an optimization objective. The appropriate approach depends on the target and on whether hard exclusions are scientifically justified.

Diagnostics, Limitations, and Common Pitfalls

Review the sequence for abrupt drops, subgroup-specific pass rates that differ substantially, and regions whose counts approach zero. A sharp drop is a prompt to inspect the criterion, its units, its implementation, and whether the candidate pool had adequate support before filtering; it is not automatically evidence of a bug. If a step leaves zero candidates, stop interpreting later conditional rates and investigate feasibility or pool coverage. Increasing the pool may help when the required candidates exist but were not generated; it cannot solve genuinely incompatible constraints.

The counts are finite-pool diagnostics. They do not establish that the selected candidates reproduce every feature of a target distribution, nor do they describe the distribution beyond the candidate pool. In particular, satisfying several marginal criteria does not guarantee satisfactory joint structure. The selected pool should be assessed against the intended targets and use, with attention to retained diversity and the consequences of sparse regions.

  • Confusing conditional and cumulative rates. \(N_j/N_{j-1}\) uses candidates reaching step \(j\); \(N_j/N_0\) uses the original pool.
  • Reporting a later rate after extinction. If \(N_{j-1}=0\), the step-specific conditional rate is undefined, even though the cumulative rate remains zero when \(N_0>0\).
  • Equating nonzero coverage with adequate coverage. A region represented by one candidate is technically occupied but may be too sparse for the intended use.
  • Interpreting a changed subgroup share without the counts. Report subgroup counts and denominators as well as percentages, especially when the retained pool is small.
  • Assuming order changes the final set for fixed filters. It changes intermediate diagnostics, but fixed filters on a fixed pool produce the same intersection in any order.
Key takeaway: For every filtering step, report the starting and remaining counts, the conditional and cumulative acceptance rates, and relevant subgroup and parameter-region counts. Define zero-denominator rates as undefined, and evaluate whether the final composition and coverage are adequate for the virtual population's purpose.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A pool starts with 200 candidates. After the first constraint, 100 remain; after the second, 25 remain. What are the second-step conditional and cumulative acceptance rates?
  2. If \(N_0=80\), \(N_1=0\), and \(N_2=0\), which cumulative rates are defined, and is the conditional rate at step 2 defined?
  3. A subgroup is 30% of the starting pool and 45% of the final pool. Does this alone show that the subgroup has more candidates in the final pool than initially?
  4. With fixed constraints applied to the same candidate pool, does changing their order change the final accepted set? What can change?
  5. Every prespecified parameter region has at least one candidate after filtering. Why might coverage still be inadequate?

Solutions. (1) The second-step conditional rate is \(25/100=0.25\), or 25%; its cumulative rate is \(25/200=0.125\), or 12.5%. (2) Both cumulative rates, \(N_1/N_0\) and \(N_2/N_0\), are defined and equal to zero. The step-2 conditional rate \(N_2/N_1\) is undefined because its denominator is zero. (3) No. Percentages give shares, not absolute counts; the final pool may be much smaller, so compare the subgroup counts and denominators. (4) No, the final set is the intersection of the fixed criteria. Intermediate counts and conditional rates can change. (5) A region with only one or a few candidates may be too sparsely represented to support the intended use, even though its count is nonzero.

Clinical Biostats