Tutorials › Marginal Structural Models › Clinically Constrained Treatment Regimes

Dynamic Treatment Regimes · Tutorial 425 of 501

Clinically Constrained Treatment Regimes

Formulate clinically feasible treatment rules and derive when backward Q-learning can select an optimal measurable rule under those constraints.

Advanced 12 min read

What You'll Learn

  • Define history-dependent feasible action sets for treatment decisions.
  • Replace unconstrained Q maximization with maximization over admissible actions.
  • Derive a backward-induction result with conditions guaranteeing measurable maximizing rules.
  • Work through eligibility, dose-limit, and sequential resource-budget examples.
  • Diagnose infeasible recommendations and distinguish individual from shared resource constraints.

Why clinical constraints change the decision problem

A fitted Q-function may assign its largest value to an action that a clinician cannot prescribe. A medication may be contraindicated for a particular patient, a dose may exceed a safety limit, or a treatment plan may use more of an individual’s remaining resource than is available. The decision rule must therefore maximize expected outcome over actions that are both clinically admissible and available at that point in the treatment history.

This is not a change to the objective being modeled. It is a change to the set over which the objective is optimized. In a sequential problem, constraints can also change what belongs in the state: if later choices depend on how much of a patient-specific budget remains, that remaining budget must be represented in the history used for later decisions.

Feasible actions and constrained Q-learning

Definition: At stage \(t\), let \(H_t\) denote the observed history immediately before treatment \(A_t\), and let \(\mathcal{A}_t(H_t)\) be the nonempty set of actions permitted at that history. A clinically constrained regime is a sequence of measurable decision rules \(g_t\) satisfying \(g_t(h)\in\mathcal{A}_t(h)\) for every history where the rule is defined. Given a Q-function \(Q_t(h,a)\), a constrained maximizing decision is an action in \(\operatorname{argmax}_{a\in\mathcal{A}_t(h)} Q_t(h,a)\).

The feasible set may encode patient-specific eligibility, such as excluding a drug when a contraindication is present; a dose interval, such as \(0\leq a\leq d_{\max}(h)\); or a treatment option available only at particular histories. It should describe the actions the clinical protocol allows, not merely the actions that happened to be observed in a data set. Whether observed data are sufficient to estimate the value of those actions is a separate support and identification question.

For a finite horizon ending at stage \(T\), write \(Y\) for the final outcome. In the population defined by the causal decision problem, define the terminal Q-function as the expected outcome under action \(a\) at the terminal history:

$$ Q_T(h,a)=E[Y\mid H_T=h,\ \text{set }A_T=a]. $$

For earlier stages, use the optimal continuation value at the next stage:

$$ V_t(h)=\max_{a\in\mathcal{A}_t(h)}Q_t(h,a), \qquad Q_t(h,a)=E[V_{t+1}(H_{t+1})\mid H_t=h,\ \text{set }A_t=a], \quad t<T. $$

These equations specify the decision recursion, not a particular estimation method. They presume the conditional laws under interventions and the expectations used in the recursion are well-defined. At each stage, the maximization is over the clinically permitted actions, not over a larger unconstrained action space.

Worked Example: A Dose Limit Rules Out the Unconstrained Maximum

Suppose a terminal-stage fitted Q-function for a continuous dose \(a\) is \(Q(h,a)=100-2(a-8)^2\). The clinical protocol allows doses only in \(\mathcal{A}(h)=[2,6]\). Find the unconstrained and constrained maximizing doses and compare their Q-values.

The quadratic is maximized when its squared term is zero, so the unconstrained maximum is at \(a=8\), with \(Q(h,8)=100\). But \(8\notin[2,6]\), so this recommendation is inadmissible.

For any \(a\in[2,6]\), the distance \(|a-8|\) is smallest at \(a=6\). Since the Q-function decreases as \((a-8)^2\) increases, the constrained maximizer is \(a=6\). Its value is \(Q(h,6)=100-2(6-8)^2=100-8=92\). At the other endpoint, \(Q(h,2)=100-2(2-8)^2=28\), which verifies that the constrained choice is better than that endpoint. Thus the protocol-compliant decision is dose 6, with modeled value 92 rather than the infeasible value 100.

Eligibility constraints in a categorical decision

With categorical treatment, clinical restrictions can remove options rather than alter a dose interval. The Q-values still compare expected outcomes on a common scale; the feasible set determines which comparisons are relevant to the recommendation.

Worked Example: A Contraindication Removes the Best Unrestricted Option

At one history, suppose the available actions are \(0\) (no treatment), \(1\) (treatment B), and \(2\) (treatment A). Their fitted Q-values are respectively 4, 7, and 9. A documented contraindication makes treatment A inadmissible, so \(\mathcal{A}(h)=\{0,1\}\). What decision does the constrained rule recommend?

Without the restriction, the largest value is \(Q(h,2)=9\), so the unrestricted rule would select treatment A. That action is not in \(\mathcal{A}(h)\). Among the admissible options, \(Q(h,1)=7>Q(h,0)=4\), so the constrained decision is action 1. Its modeled value is 7. The recommendation is not to use action 2 because its numerical Q-value is highest; the comparison is restricted to actions the protocol permits.

Backward maximization and measurable rules

Pointwise maximization is not alone enough to establish that a valid regime exists. An action attaining the maximum at each history must also be selectable as a measurable function of history. The following sufficient conditions make that requirement explicit.

Theorem: Consider a finite-horizon problem with standard Borel history spaces and a compact metric action space. Suppose each feasible-action correspondence \(h\mapsto\mathcal{A}_t(h)\) has nonempty compact values and a measurable graph. Suppose the Q-functions are measurable in history and continuous in action on the feasible sets, and the conditional transition and outcome laws make the displayed expectations finite and measurable. Assume these conditions hold recursively so that the constrained value functions are measurable and the measurable maximum theorem applies at every stage. Then there are measurable selectors \(g_t^*(h)\in\mathcal{A}_t(h)\) attaining each constrained maximum, and the regime \(g^*=(g_1^*,\ldots,g_T^*)\) has expected outcome at least as large as every measurable regime obeying the constraints.

The compactness and continuity assumptions are convenient sufficient conditions, not the only possible ones. More general measurable-selection results can be used when their hypotheses hold. Nonempty feasible sets and attained pointwise maxima by themselves do not guarantee a measurable regime.

Proof. Define \(V_T(h)=\max_{a\in\mathcal{A}_T(h)}Q_T(h,a)\). The compact feasible sections and continuity in \(a\) ensure that this maximum is attained; the measurable maximum theorem gives a measurable maximizing selector \(g_T^*\). Recursively for \(t<T\), define \(Q_t\) using the conditional law of \(H_{t+1}\) and the already defined \(V_{t+1}\), and set \(V_t(h)=\max_{a\in\mathcal{A}_t(h)}Q_t(h,a)\). By the stated recursive measurability and maximum-theorem conditions, this maximum is attained and has a measurable selector \(g_t^*\).

To compare regimes, let \(g\) be any measurable feasible regime. At the terminal stage, for each relevant \(h\), \(Q_T(h,g_T(h))\leq V_T(h)=Q_T(h,g_T^*(h))\). Now suppose the optimal continuation value \(V_{t+1}\) is at least the conditional expected outcome under \(g\)'s continuation, at every relevant next history. Conditional on \(H_t=h\) and setting \(A_t=g_t(h)\), taking expectations of that inequality gives an expected outcome no larger than \(Q_t(h,g_t(h))\). Since \(g_t(h)\in\mathcal{A}_t(h)\), \(Q_t(h,g_t(h))\leq V_t(h)\). By construction, choosing \(g_t^*(h)\) attains \(V_t(h)\), and its continuation uses the maximizing selectors at all later stages. Backward induction therefore shows that the conditional expected outcome under \(g\) is no greater than under \(g^*\) at the initial history. Averaging over the initial-history distribution preserves the inequality, so the regime \(g^*\) has expected outcome at least as large as every feasible \(g\). \(\square\)

Resource limits across treatment stages

A resource restriction that applies across a patient’s stages is not generally a fixed action cap at each stage. If current treatment changes what can be given later, the remaining resource must be part of the state. Backward Q-learning can then optimize subject to the budget by including that state in the history and restricting each next action to what remains feasible.

Worked Example: A Two-Stage Individual Treatment Budget

At each of two stages, dose \(a_t\) must be 0, 1, or 2 units. A patient has a total budget of 2 units, so \(a_1+a_2\leq2\). The outcome contribution is \(3a_1+2a_2\). Let \(r\) be the budget remaining before stage 2. Find the backward-optimal treatment plan.

At stage 2, the feasible dose is \(a_2\in\{0,\ldots,\min(2,r)\}\). Since each unit adds 2 to the outcome, the optimal stage-2 dose is \(\min(2,r)\), and its continuation value is \(V_2(r)=2\min(2,r)\).

At stage 1, choosing \(a_1\) leaves \(2-a_1\) units. Evaluate all feasible choices: \(a_1=0\) gives \(0+V_2(2)=4\); \(a_1=1\) gives \(3+V_2(1)=3+2=5\); and \(a_1=2\) gives \(6+V_2(0)=6\). Thus the unique maximizing first dose is \(a_1=2\), followed by \(a_2=0\), for total outcome 6. Choosing dose 2 independently at both stages would give an apparent outcome of \(3(2)+2(2)=10\), but it violates the total budget. The remaining budget is the state variable that prevents the backward rule from recommending that infeasible plan.

A shared resource constraint across different patients is different. If one patient’s treatment uses a pool that limits what can be assigned to others, their decisions are coupled. Optimizing each patient’s Q-function independently need not satisfy the population-level budget or optimize the constrained aggregate objective. Such a problem needs a joint allocation formulation, or an appropriate augmented resource state or constrained optimization method; it is not solved simply by applying an individual feasible-set restriction to each patient.

Diagnostics, alternatives, and limitations

A constrained decision rule should be checked for both clinical validity and optimization validity. Useful checks include the following:

  • Feasibility audit. For histories used to make recommendations, verify that the selected action belongs to the documented feasible set, including boundary rules and patient-specific exclusions.
  • Unrestricted-versus-restricted comparison. Record whether the unrestricted maximizing action was excluded and which admissible action replaced it. A large difference in modeled Q-value can signal a consequential constraint or a model scale problem worth examining.
  • Resource accounting. For a cumulative individual budget, check that every recommended sequence respects the total limit, not just each stage’s separate dose cap.
  • Support and model checks. A clinically feasible action may still be poorly represented in the observed data. Sparse observations or unstable fitted Q-values near a constraint boundary can make recommendations unreliable even when the rule is mathematically feasible.
  • Measurability and implementation. Confirm that the decision can be computed from information available at the decision time and that the feasible set and selector are well-defined as history changes.

The main alternative is unrestricted Q maximization, which is appropriate only when every action in the optimization domain is genuinely allowable. Clipping an unconstrained continuous recommendation to a dose limit can agree with constrained maximization for a concave, unimodal Q-function on an interval, as in the quadratic example. It is not a general substitute: with a nonconcave function, an irregular feasible set, or history-dependent options, the best feasible action need not be obtained by simple clipping. Explicitly maximizing over \(\mathcal{A}_t(h)\) remains the general formulation.

Clinical constraints also do not repair a misspecified Q-model, guarantee adequate data support for each allowed action, or resolve conflicts between a patient’s individual optimum and a shared population resource target. The recommendation is optimal relative to the modeled outcome, the stated feasible sets, and the assumptions that justify the Q-functions. Those qualifications should accompany interpretation of any constrained rule.

Common pitfall: “The fitted Q-function is largest at this action, so the rule should recommend it.” That reasoning ignores admissibility. The correction is to identify the history-specific feasible set first and maximize Q only over that set. For sequential resource limits, also carry the remaining resource into later-stage histories; separate stagewise maxima can otherwise violate the joint constraint.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A dose has Q-function \(Q(a)=20-(a-5)^2\), but the permitted interval is \([0,3]\). What dose is selected, and what is its Q-value?
  2. At a history, two admissible categorical actions have Q-values 8 and 6, while an inadmissible action has Q-value 12. Which action is recommended?
  3. Why can nonempty feasible sets and pointwise-attained maxima still be insufficient to define a constrained regime?
  4. A patient has one unit of a treatment resource remaining. The next-stage feasible doses are 0, 1, and 2, and each unit adds 4 to the outcome. What is the best feasible dose and continuation value?

Solutions. (1) The unconstrained peak is at \(a=5\), to the right of the permitted interval. On \([0,3]\), the closest point to 5 is 3, so the constrained dose is 3 and \(Q(3)=20-(3-5)^2=16\). (2) Compare only admissible actions: the action with value 8 is recommended; the infeasible value 12 is irrelevant to the constrained maximum. (3) Choosing an attaining action separately at each history need not produce a measurable function of history. Conditions such as standard measurable spaces, suitable feasible-set correspondences, regular Q-functions, and a measurable maximum theorem are needed to ensure measurable selectors. (4) The remaining resource excludes dose 2. Dose 1 is feasible and has value \(4(1)=4\), greater than the value 0 from dose 0, so the best dose is 1 and the continuation value is 4.

Clinical Biostats