Tutorials › Optimal Design and Model-Informed Dosing › Building a Data-Generating Model

Simulation Studies of Designs · Tutorial 437 of 497

Building a Data-Generating Model

Build a coherent model that turns a trial protocol and population assumptions into realistic individual concentration profiles and observed data.

Intermediate 12 min read

What You'll Learn

  • Separate the structural model, individual parameters, and observed measurements.
  • Specify a PK model with interpretable parameter values and units.
  • Represent between-subject variability using random effects.
  • Define an observation process that includes residual error and measurement times.
  • Check assumptions, units, and model implications before generating trial data.
  • Recognize when a model is too simple or inconsistent with the intended trial.

What a Data-Generating Model Must Specify

A simulation produces useful evidence only if its generated data represent a plausible version of the trial being studied. The model must describe more than a population-average curve: it must connect the protocol, individual differences, and measurement process to the records that would be available for analysis. A concise way to organize this task is to distinguish the structural model (the expected individual trajectory), the parameter model (how individual parameters relate to population values and covariates), and the observation model (how expected values become measurements).

The data-generating model is a set of explicit assumptions, not a claim that the simulated process is the true biological mechanism. Its complexity should be sufficient to represent features that could affect the design comparison, while remaining specified well enough to generate and check data. The simulation question and performance estimand defined in earlier material determine which features matter; this tutorial focuses on translating those needs into a coherent model.

Definition: A data-generating model specifies how trial inputs and population assumptions produce individual-level latent outcomes and, through an observation process, the data recorded for analysis. It includes a structural model, parameter values and their individual variation, and rules for when and how observations are generated.

Structural Model: From Protocol to Individual Trajectory

The structural model defines the expected response for an individual given that person's parameters, covariates, and treatment history. In pharmacokinetics, it may be expressed as differential equations for drug amount or concentration, or as a formula giving concentration at a specified time. The protocol supplies inputs such as dose, route, dosing time, and planned sample time; the structural model maps these inputs to an expected concentration.

Consider a one-compartment model after a single intravenous bolus dose. Assume instantaneous mixing, linear elimination, and constant clearance and volume over the observation period. Let \(A(t)\) be the amount of drug in the compartment, \(CL\) clearance, and \(V\) volume of distribution. Elimination is proportional to the amount present, so the model is \(dA(t)/dt=-(CL/V)A(t)\). Since \(A(0)=D\) after a bolus dose and concentration is \(C(t)=A(t)/V\), solving the equation gives:

$$ C(t)=\frac{D}{V}\exp\left(-\frac{CL}{V}t\right),\qquad t\geq 0. $$

This expression is the expected concentration, not yet an observed assay result. Its units provide an immediate check: if \(D\) is in mg, \(V\) in L, and \(CL\) in L/h, then \(D/V\) is mg/L and \(CL/V\) is h\(^{-1}\). Multiplying \(CL/V\) by time in hours gives a dimensionless exponent. A mismatch in units often signals an error in the model implementation or the protocol inputs.

Worked Example: A Single-Dose Structural Prediction

Suppose a hypothetical trial gives a 100 mg IV bolus to an individual with \(CL=5.0\) L/h and \(V=50\) L. Under the one-compartment assumptions above, predict the expected concentration at 5 h.

The elimination rate constant is \(CL/V=5.0/50=0.100\) h\(^{-1}\), and the initial concentration is \(D/V=100/50=2.00\) mg/L. Substituting into the structural model:

$$ C(5)=2.00\exp[-(0.100)(5)]\ \mathrm{mg/L} =2.00\exp(-0.500) =1.213\ \mathrm{mg/L}. $$

Thus, 1.213 mg/L is the model-predicted concentration for this individual at 5 h, before residual measurement error. This prediction assumes the dose was administered as specified, the sample time is measured from the bolus, and the individual's parameters remain constant.

Population Parameters, Covariates, and Random Effects

A population model defines how individual parameters are distributed around typical values. A common pharmacometric specification uses exponential random effects. For example, let \(\theta_{CL}\) be the typical clearance and \(\eta_{CL,i}\) the random effect for individual \(i\):

$$ CL_i=\theta_{CL}\exp(\eta_{CL,i}),\qquad \eta_{CL,i}\sim N(0,\omega_{CL}^{2}). $$

This form guarantees positive clearance. The typical value \(\theta_{CL}\) is the median of the individual clearance distribution when the random effect has mean zero; it is not generally the arithmetic population mean. The variance \(\omega_{CL}^{2}\) describes variation on the log scale. Multiple random effects can be specified jointly, for example for clearance and volume, with a covariance matrix \(\Omega\). If the effects are assumed independent, the off-diagonal covariance is zero; that assumption should be explicit rather than silently imposed.

Covariates can enter the parameter model when they are part of the intended population representation. For example, a weight-adjusted clearance model might use \(CL_i=\theta_{CL}(WT_i/70)^{0.75}\exp(\eta_{CL,i})\), where \(WT_i\) is weight in kg and 70 kg is the reference weight. The equation states both the size effect and the residual individual variability. A covariate relationship should be scientifically defensible over the simulated range; extrapolating it far beyond the data or population supporting it can create implausible generated values.

Worked Example: Translating Random Effects Into Individual Parameters

Use the same hypothetical bolus model, but let the typical values be \(\theta_{CL}=5.0\) L/h and \(\theta_V=50\) L. Suppose the simulated individual's random effects are \(\eta_{CL}=0.20\) and \(\eta_V=-0.10\). For this calculation, the effects are treated as specified values; their population distribution is not needed to calculate this individual's prediction.

The individual parameters are:

$$ CL_i=5.0\exp(0.20)=6.107\ \mathrm{L/h},\qquad V_i=50\exp(-0.10)=45.24\ \mathrm{L}. $$

For a 100 mg bolus, \(CL_i/V_i=6.107/45.24=0.1350\) h\(^{-1}\), and \(D/V_i=100/45.24=2.210\) mg/L. Therefore:

$$ C_i(5)=2.210\exp[-(0.1350)(5)] =2.210\exp(-0.6749) =1.125\ \mathrm{mg/L}. $$

The model predicts 1.125 mg/L for this individual at 5 h, compared with 1.213 mg/L at the typical parameter values. The difference arises from the specified individual effects, not from measurement error. Whether random effects are correlated, and how their values are generated across a trial, must be part of the model specification.

The Observation Process: From Expected Values to Records

A structural model generates expected values at times of interest. An observation model describes the relationship between those values and recorded measurements. A widely used combined additive-and-proportional error model is:

$$ Y_{ij}=C_i(t_{ij})(1+\epsilon_{p,ij})+\epsilon_{a,ij}, \qquad \epsilon_{p,ij}\sim N(0,\sigma_p^2),\quad \epsilon_{a,ij}\sim N(0,\sigma_a^2). $$

Here \(Y_{ij}\) is the measured concentration for individual \(i\) at sample time \(t_{ij}\), and \(C_i(t_{ij})\) is the model-predicted concentration. The proportional error has no concentration units, while the additive error and \(\sigma_a\) have concentration units. Under the stated assumptions that both errors have mean zero, are independent of each other, and are independent across observations, the conditional mean is \(C_i(t_{ij})\) and the conditional variance is \(C_i(t_{ij})^2\sigma_p^2+\sigma_a^2\).

The observation process also specifies which records are generated: planned sample times, measurement units, and any protocol-defined rules for whether a measurement is available or quantifiable. These details must agree with the trial being represented. For example, generating concentrations at scheduled times while analyzing them as if they were collected at nominal times may be inappropriate if actual sample-time deviations are large. Likewise, a residual-error model that allows negative concentrations may be unsuitable when the intended data and analysis require strictly positive observations; a log-scale error model may be more appropriate in that setting.

Worked Example: Applying a Combined Error Model

Suppose a hypothetical individual has a predicted concentration of 1.200 mg/L at a planned sample time. Let \(\sigma_p=0.15\) and \(\sigma_a=0.05\) mg/L. For one illustrative realization, take \(\epsilon_p=-0.060\) and \(\epsilon_a=0.020\) mg/L. These values are possible realizations of the two error terms; this calculation does not assert that they are typical.

Substitution gives:

$$ Y=1.200(1-0.060)+0.020 =1.128+0.020 =1.148\ \mathrm{mg/L}. $$

The recorded value is 1.148 mg/L, while 1.200 mg/L remains the model-predicted mean at that time. The distinction matters: a simulated dataset contains measurements, not just structural predictions. The model implies a conditional variance of \((1.200)^2(0.15)^2+(0.05)^2=0.0349\ (\mathrm{mg/L})^2\), corresponding to a conditional standard deviation of approximately 0.1868 mg/L.

Justifying and Checking the Model

A data-generating model is coherent only when its parts fit together. Before generating trial records, check that doses, times, covariates, parameters, and observations use compatible units; that parameter values obey required constraints such as positive clearance and volume; and that the structural equations match the route and dosing schedule. For repeated dosing, for example, a single-dose formula cannot simply be used without accounting for prior doses and the dosing history.

Also check the implied data, not only the equations. Plot or tabulate predicted concentration-time profiles over the intended covariate and parameter ranges. Look for negative or implausibly large values, implausible accumulation, and profiles that do not reflect known qualitative features of the drug or trial. Under the one-compartment IV bolus model, concentrations must decrease monotonically after the bolus because \(CL/V>0\); a generated increase would indicate an implementation error or a different process than the one specified.

The main alternatives are choices of structural and observation models, not interchangeable labels for the same assumptions. A one-compartment model is relatively simple and may be adequate for a design question about broad sampling coverage, while a multi-compartment model is needed if distribution phases materially affect the sampling times being evaluated. A proportional error model makes measurement variability increase with concentration, whereas an additive model assigns constant variance on the measurement scale. The combined model accommodates both patterns but introduces two error parameters. Model choice should follow the intended setting and available evidence, not convenience alone.

A common mistake is to simulate from the population-typical curve and call the result a realistic trial dataset. That omits between-subject variability, so all individuals have the same trajectory before residual error; it can underrepresent heterogeneity that affects design performance. The correction is to specify the individual parameter model as well as the structural model. A different mistake is to treat residual error as a substitute for random effects. Residual error describes deviations of observations from an individual's expected trajectory; random effects describe persistent differences in individual parameters or trajectories. These sources of variation act at different levels and should not be conflated.

No model is universally realistic. A model can omit time-varying physiology, adherence variation, assay features, or missingness processes that matter in a particular trial. It may also be poorly supported in a population outside the range of the evidence used to specify it. State these limitations, and ensure the chosen assumptions are relevant to the design question. More detail is not automatically better: unsupported complexity can make the simulation difficult to interpret without making it more credible.

Key takeaway: A usable data-generating model links protocol inputs to expected individual trajectories, individual variation, and recorded measurements. State the assumptions and units at each link, then inspect whether the resulting data are plausible for the trial question.

Check Your Understanding

Answer each question using the model definitions above. Solutions are provided below the questions.

  1. For the one-compartment IV bolus model, what are the units of \(CL/V\), and why must the exponent in the concentration equation be dimensionless?
  2. If \(CL_i=\theta_{CL}\exp(\eta_i)\) and \(\eta_i=0\), what is \(CL_i\)? What does \(\theta_{CL}\) represent under a zero-mean normal random effect?
  3. At a predicted concentration of 2.0 mg/L, let \(\sigma_p=0.10\) and \(\sigma_a=0.20\) mg/L. Under the independent combined-error model, calculate the conditional variance and standard deviation.
  4. Explain why random effects and residual error should not be treated as the same source of variation.

Solutions. (1) If \(CL\) is in L/h and \(V\) is in L, then \(CL/V\) is h\(^{-1}\). Its product with time in h is dimensionless, as required for the exponential function. (2) \(CL_i=\theta_{CL}\exp(0)=\theta_{CL}\). With \(\eta_i\sim N(0,\omega^2)\), \(\theta_{CL}\) is the median individual clearance under the exponential model. (3) The variance is \((2.0)^2(0.10)^2+(0.20)^2=0.040+0.040=0.0800\ (\mathrm{mg/L})^2\); the standard deviation is \(\sqrt{0.0800}=0.2828\) mg/L. (4) Random effects describe persistent individual differences in parameters or trajectories; residual error describes measurement-level deviations around an individual's expected value. They occur at different levels of the model and have different implications for simulated data.

Clinical Biostats