Tutorials › Quantitative Systems Pharmacology (QSP) › Endogenous States Versus External Forcing Inputs

Defining Model Scope and Boundaries · Tutorial 19 of 799

Endogenous States Versus External Forcing Inputs

Learn to classify changing biological drivers as endogenous states or prescribed inputs, and see how that boundary changes model equations and counterfactual predictions.

Intermediate 11 min read

What You'll Learn

  • Define endogenous states and external forcing inputs in a dynamic model
  • Distinguish a changing input from a quantity whose dynamics are represented inside the model
  • Work through examples involving disease progression, co-medication, and environmental exposure
  • Use feedback, decision relevance, and available evidence to guide the boundary choice
  • Identify common modeling errors and check whether an input is truly prescribed

Why the distinction matters

A QSP model needs to represent how relevant quantities change over time. Some quantities change because of mechanisms represented inside the model; others are supplied to it as specified conditions or exposures. The first are modeled as states; the second act as inputs. This is a boundary choice, not a claim that an external input is biologically unimportant or unchanging.

For example, disease burden may progress in response to treatment, while a co-medication concentration may be supplied from an externally specified dosing profile. Environmental exposure may be prescribed as a measured time course. But if the question requires predicting how that co-medication or exposure changes in response to modeled processes, its dynamics may need to be represented inside the model. The appropriate choice depends on the decision, time horizon, feedbacks, and evidence needed for the intended prediction.

Definition: A state is a modeled quantity whose value at the current time is part of the model's description of the system and whose change is specified by a state equation. An endogenous state evolves through mechanisms represented within the model. An external forcing input is a time-varying quantity supplied to the model rather than generated by its state equations. A general representation is
$$ \frac{d\mathbf{x}}{dt}=f(\mathbf{x},\mathbf{u},\boldsymbol{\theta},t), $$
where \(\mathbf{x}\) is the vector of states, \(\mathbf{u}\) is the vector of inputs, and \(\boldsymbol{\theta}\) denotes parameters. The functions and parameters specify how the states respond to the current states and inputs.

An input can vary over time, and a state can be observed or unobserved. Neither property decides its classification. What matters is whether the model supplies an evolution rule for the quantity or instead receives its values from outside. A changing input is not automatically a state; a state need not be directly measurable.

A practical boundary test

Start from the intended prediction or decision. Ask whether changes in the candidate quantity need to be predicted by the model, and whether those changes depend on other modeled quantities or on the intervention being evaluated. If so, representing it as a state may be necessary. If a defensible time course can instead be specified independently for the purpose at hand, it may be treated as an input.

This test also guards against adding detail without a modeling purpose. A quantity can be biologically real and influential yet remain an input if its profile is known and is not required to respond to modeled processes. Conversely, a quantity that is usually prescribed can require a state equation in a counterfactual where its dynamics or feedback become important. An external profile can also be uncertain: uncertainty in a specified input does not by itself turn it into a state.

1
Identify the candidate driver.
State what the quantity represents, its units, and the relevant time course.
2
Check for modeled evolution and feedback.
Ask whether its future values depend on current model states, treatment, or processes included in the model.
3
Check the decision and available evidence.
If a prediction requires the driver to respond to a counterfactual intervention, a fixed external profile may be inadequate. If its trajectory is specified and independent over the intended use, an input can be more appropriate.
4
State the boundary assumption.
Document what supplies an input profile and which feedbacks are excluded. Revisit the choice if the intended prediction changes.

Disease progression as an endogenous state

Disease burden is often modeled as a state when the question concerns how it changes under treatment. Its trajectory can then influence a clinical outcome, while treatment can alter the trajectory. The following simple model is illustrative, not a representation of a particular disease.

Worked Example: Disease Burden Changes Under Treatment

Suppose a hypothetical disease burden \(x(t)\), measured in burden units, grows at a constant per-day rate \(r\) and is reduced by treatment at a constant per-day rate \(k u\). The dimensionless treatment input \(u\) is held at 1. Assume the model

$$ \frac{dx}{dt}=(r-ku)x,\qquad x(0)=10\ \text{burden units}, $$

with \(r=0.08\ \text{day}^{-1}\), \(k=0.03\ \text{day}^{-1}\), and constant \(u=1\). This assumes the rates remain constant over the interval, the net rate is proportional to burden, and no other process changes the burden. With these assumptions, separating variables or solving the linear differential equation gives

$$ x(t)=x(0)\exp((r-ku)t). $$

At day 10, substitution gives

$$ x(10)=10\exp((0.08-0.03)\times 10) =10\exp(0.5) \approx 16.49\ \text{burden units}. $$

Here \(x(t)\) is endogenous: its future value is generated by the model's state equation. The treatment level \(u\) is an input in this example because it is prescribed and held fixed, not predicted by a treatment-adherence model. If treatment were adjusted in response to the predicted burden, that feedback would need to be represented rather than silently assumed away.

The classification concerns the boundary of this particular model. A disease measure could instead be used as an input when the goal is to calculate a downstream response to a supplied disease trajectory, without predicting disease progression. The same biological quantity can therefore be a state in one model and an input in another.

Co-medication: prescribed profile or modeled dynamics?

A co-medication can be treated as an input when its concentration or effect profile is supplied independently, and the model does not need to predict changes in it. For example, a specified co-medication profile might modify a target drug's clearance. That is a boundary assumption: it excludes feedback from the modeled target drug or disease onto the co-medication profile.

Worked Example: A Co-medication Concentration as an Input

Suppose a hypothetical co-medication concentration \(C_m(t)\), in mg/L, is supplied as an external profile:

$$ C_m(t)=C_0\exp(-k_{\mathrm{el}}t), $$

where \(C_0=4.00\ \text{mg/L}\) and \(k_{\mathrm{el}}=0.35\ \text{day}^{-1}\). Suppose its effect on a modeled target-drug process is represented by the dimensionless factor \(1/(1+C_m/K_i)\), with \(K_i=2.00\ \text{mg/L}\). This simple relationship assumes the concentration profile and \(K_i\) are known and that the effect is adequately represented by this function. At day 2,

$$ C_m(2)=4.00\exp(-0.35\times2) =4.00\exp(-0.70) \approx 1.986\ \text{mg/L}. $$

The corresponding factor is

$$ \frac{1}{1+C_m(2)/K_i} =\frac{1}{1+1.986/2.00} \approx 0.5017. $$

Thus the modeled process is multiplied by about 0.502 at day 2 under this hypothetical relationship. In this setup \(C_m(t)\) is an input: its formula supplies the profile, and the model does not solve for it. If the intended question requires predicting that concentration from the co-medication dose, or requires a target-drug interaction to alter it, the profile may no longer be an adequate external input. Its pharmacokinetic dynamics or relevant feedback may need to be represented as states.

A useful diagnostic is to inspect how an input profile was obtained. A schedule specified by the analyst is not the same thing as a concentration curve measured or predicted under a separate model. Either may be used as an input, but the source and assumptions should be clear. If a counterfactual changes a factor that generated the profile, reusing the original profile without justification can produce an inconsistent prediction.

Environmental exposure as a forcing input

An environmental exposure can be prescribed as a time course when the model uses it to drive a biological response but does not predict the exposure itself. The resulting biological response can still be a state, because its accumulation and decay are generated inside the model. This separation is useful when the exposure is measured or specified for the question, while the response depends on prior exposure.

Worked Example: Exposure Drives a Dynamic Biomarker

Let \(E(t)\) be a hypothetical external exposure in mg/m\(^3\), held at \(2.00\ \text{mg/m}^3\) for the first 2 days and then set to zero. Let \(z(t)\) be a biomarker response in dimensionless response units. Assume

$$ \frac{dz}{dt}=aE(t)-bz,\qquad z(0)=0, $$

with \(a=0.200\) response units per \((\text{mg/m}^3\cdot\text{day})\) and \(b=0.500\ \text{day}^{-1}\). This assumes a linear response to exposure, first-order loss of the response, and fixed parameters. While exposure is present, \(aE=0.400\) response units per day. Solving the constant-forcing equation gives

$$ z(t)=\frac{aE}{b}\left(1-\exp(-bt)\right) =0.800\left(1-\exp(-0.500t)\right). $$

At day 2, the arithmetic is

$$ z(2)=0.800\left(1-\exp(-0.500\times2)\right) =0.800\left(1-\exp(-1)\right) \approx 0.506\ \text{response units}. $$

After exposure ends, the forcing term is zero, so \(z\) decays according to \(dz/dt=-0.500z\). At day 4,

$$ z(4)=z(2)\exp(-0.500\times2) \approx 0.5057\times0.3679 \approx 0.186\ \text{response units}. $$

In this model \(E(t)\) is external and \(z(t)\) is endogenous. If instead the question concerns how an environmental concentration builds up or clears in a relevant biological domain, a concentration or burden may need to be modeled as a state. The exposure label alone does not settle the choice.

Why the state equation responds to input history

The exposure example also shows why a dynamic response cannot always be replaced by its value at the current instant. For a general constant \(a\), constant \(b>0\), and time-varying input \(E(t)\), the equation \(dz/dt=aE(t)-bz\) can be solved by multiplying through by the integrating factor \(\exp(bt)\):

$$ \exp(bt)\frac{dz}{dt}+b\exp(bt)z =a\exp(bt)E(t) \quad\Longrightarrow\quad \frac{d}{dt}\left(\exp(bt)z(t)\right) =a\exp(bt)E(t). $$

Integrating from 0 to \(t\), then multiplying by \(\exp(-bt)\), gives

$$ z(t)=z(0)\exp(-bt) +a\int_0^t \exp(-b(t-s))E(s)\,ds. $$

The response depends on the input history, not just its current value. The state \(z\) carries that history forward through its current value. This is a direct reason to represent a response as a state when its persistence is relevant to the prediction.

Diagnostics, alternatives, and limitations

There is no universal rule that every driver must be a state or that every external factor must be an input. The choice should be checked against the intended use. Warning signs include an input profile that changes in a counterfactual even though the model has no rule to generate that change, or a supposedly fixed state that has no specified dynamics or initial value. Another warning sign is a model output that changes substantially when the candidate driver is held fixed, even though the decision depends on its response to treatment.

A prescribed input is often simpler and can be appropriate when it is independently known over the relevant conditions. A state-based representation can support predictions of how the quantity changes with modeled mechanisms, but requires an evolution rule, initial conditions, and supporting evidence. A third option is to summarize a driver as a fixed parameter or covariate when it is effectively constant over the modeled time course. That option cannot represent meaningful within-course variation.

The limitations follow from the boundary assumption. Treating an input as independent can omit feedback or response to an intervention. Treating a driver as a state can add poorly supported dynamics and parameters without improving the decision. A time-varying input may also be uncertain, measured with error, or available only for part of the relevant time course; those issues should be acknowledged rather than hidden by the input/state label. The distinction does not itself establish that a mechanism is known or that a model prediction is reliable.

  • Do not equate “external” with “constant.” A forcing input can vary over time.
  • Do not equate “state” with “measured.” A state may be latent if its dynamics are part of the model.
  • Do not call a supplied concentration a predicted state. If the model receives its values from a profile, it is functioning as an input in that model.
  • Do not reuse an input blindly in a counterfactual. Check whether the changed intervention would alter the process that generated the profile.
Key takeaway: A state is generated by an evolution rule inside the model; an input is supplied to that rule from outside. Choose the boundary according to what must respond to the decision-relevant perturbation, and make the independence and feedback assumptions explicit.

Check Your Understanding

For each question, decide what the model boundary implies. Brief solutions follow the questions.

  1. A model predicts a biomarker's recovery after a treatment is stopped. Should the biomarker be a state or a prescribed input if recovery dynamics are part of the prediction?
  2. A co-medication profile is provided from an external source and assumed not to change when the modeled treatment dose changes. How is it represented, and what assumption is being made?
  3. An environmental concentration is fixed at zero after day 2, but the modeled response remains positive after day 2. Is that necessarily inconsistent?
  4. In the disease example, what is the net per-day rate when \(r=0.08\ \text{day}^{-1}\), \(k=0.03\ \text{day}^{-1}\), and \(u=1\)?

Solutions. (1) The biomarker is a state because its recovery trajectory is generated by modeled dynamics. (2) The co-medication profile is an external input; the assumption is that its profile is independent of the modeled treatment dose and other modeled states. (3) No. A response state can persist and decay after its forcing input ends, as \(dz/dt=-bz\) in the example. (4) The net rate is \(r-ku=0.08-(0.03)(1)=0.05\ \text{day}^{-1}\), which is positive.

Clinical Biostats