Why Parametric Covariate Sampling?
A virtual population needs covariate values that represent a specified target population. When individual records are unavailable, or when a smooth distribution is the intended representation, a parametric distribution offers a way to generate those values. The choice is consequential: a distribution determines not only typical values but also the frequency of unusual values and, for bounded distributions, which values are possible at all.
This tutorial treats one continuous covariate at a time. It focuses on specifying a marginal distribution, generating values from it, and translating them into useful units. A simulated draw is not automatically a clinically plausible value merely because it came from a well-known distribution. The distribution, its parameterization, and the units must all match the intended target.
The distribution describes variation between individuals in the target population; it is not a model for uncertainty in a pharmacometric parameter estimate. If the target population is described by a mean and standard deviation, those values are population-distribution parameters, not automatically the sample mean \(\bar{x}\) and sample standard deviation \(s\) of a finite simulated population. The earlier material on defining target covariate populations is relevant here: a distribution should represent the population the simulation is meant to address.
Specify the Distribution Before Drawing
A continuous distribution is specified by its family, parameters, and measurement scale. For a normal model, \(X\sim N(\mu,\sigma^2)\), \(\mu\) is the mean and \(\sigma\) is the standard deviation; the second argument is the variance. The model has support over all real numbers. That can be suitable for some measurements, but it can generate negative or otherwise implausible values for covariates that are necessarily positive.
A lognormal model is appropriate for a strictly positive quantity when its logarithm is modeled as normal. If \(\log(X)\sim N(\mu_{\log},\sigma_{\log}^2)\), then \(X\) is lognormal and cannot be negative. Its parameters are on the log scale, which makes it essential to distinguish them from the arithmetic mean and standard deviation on the original scale. For this model, the arithmetic mean is \(\exp(\mu_{\log}+\sigma_{\log}^2/2)\), and the variance is \((\exp(\sigma_{\log}^2)-1)\exp(2\mu_{\log}+\sigma_{\log}^2)\).
For a variable bounded between known limits, a beta distribution can be rescaled to that interval. A beta variable \(Y\) lies between 0 and 1. If the clinically meaningful covariate lies between \(L\) and \(U\), set \(X=L+(U-L)Y\). The beta distribution can represent different shapes within the bounds, but its parameters must be chosen to match plausible target moments or other available information.
Generating Draws and Transforming Scales
Many simulation tools generate standard normal draws \(Z\sim N(0,1)\) or uniform draws \(U\) between 0 and 1. A normal draw is obtained as \(X=\mu+\sigma Z\). More generally, if \(F\) is a continuous cumulative distribution function, an inverse-transform draw is \(X=F^{-1}(U)\). Because \(P(U\leq u)=u\) for \(0\leq u\leq1\), this transformation gives \(P(F^{-1}(U)\leq x)=F(x)\), so the resulting draw has cumulative distribution function \(F\).
For a lognormal variable, draw \(Z\sim N(0,1)\), form \(\log(X)=\mu_{\log}+\sigma_{\log}Z\), and exponentiate. If the target information is reported as an arithmetic mean \(m\) and coefficient of variation \(CV\), the log-scale parameters follow from the lognormal moment formulas:
Here \(CV\) is the standard deviation divided by the arithmetic mean on the original scale. These formulas are specific to the lognormal model; using \(m\) itself as \(\mu_{\log}\), for example, would mix scales and produce an incorrect distribution.
For a beta variable \(Y\sim\operatorname{Beta}(a,b)\), its mean is \(a/(a+b)\) and variance is \(ab/[(a+b)^2(a+b+1)]\). If the desired mean and variance on the unit interval are \(m_Y\) and \(v_Y\), define the concentration \(k=a+b\). Solving the mean and variance equations gives:
This parameterization requires \(0<m_Y<1\) and a variance compatible with a beta distribution, in particular \(0<v_Y<m_Y(1-m_Y)\). If the interval is scaled to \([L,U]\), first convert the target moments to the unit interval: \(m_Y=(m_X-L)/(U-L)\) and \(v_Y=v_X/(U-L)^2\).
Worked Example: Sampling Height From a Normal Model
Suppose, hypothetically, that a target adult population is represented for a simulation by height \(X\sim N(170,8^2)\), with height measured in centimeters. The model assumes a mean of 170 cm and a standard deviation of 8 cm, and assigns positive probability to all real values. For this example, suppose the normal approximation is considered adequate for the target and its negligible probability of negative height is acceptable.
To illustrate the transformation, take three standard normal values \(z=-1,\;0.5,\;1.5\). These are illustrative draws, not a claim that they are the only possible outputs. Applying \(X=\mu+\sigma Z\):
The simulated values are 162 cm, 174 cm, and 182 cm. The first is one standard deviation below the model mean, the second is half a standard deviation above it, and the third is one and a half standard deviations above it. Each value is in the same units as the specified mean and standard deviation. A larger simulated population would not generally have a sample mean exactly equal to 170 cm; random variation in finite samples is expected.
Worked Example: Converting a Positive Covariate to a Lognormal Model
Suppose a hypothetical simulation targets body weight with arithmetic mean \(m=70\) kg and coefficient of variation \(CV=0.25\). A lognormal model is selected because weight is positive and a right-skewed distribution is considered plausible. The selection is a modeling assumption, not a consequence of knowing only the mean and coefficient of variation.
First calculate the log-scale variance and standard deviation:
Then calculate the log-scale mean:
For illustrative standard normal draws \(Z=-1,0,1\), the simulated weights are:
The middle value is the median, \(\exp(\mu_{\log})\), not the arithmetic mean of 70 kg. The model’s arithmetic mean is 70 kg by the parameter conversion. Its right skew means equal-sized steps on the log scale do not correspond to equal-sized differences in kilograms.
Worked Example: Rescaling a Beta Distribution to Clinical Units
Suppose a hypothetical covariate is serum albumin, represented within a clinically chosen interval from \(L=2.5\) to \(U=5.0\) g/dL. For illustration, assume the target mean is 4.0 g/dL and the target standard deviation is 0.5 g/dL. These bounds and moments are stipulated for this example; a real application would need to justify them for its target population.
Rescale the mean and variance to the unit interval. The interval width is \(U-L=2.5\) g/dL, so:
The beta concentration and shape parameters are:
Thus \(Y\sim\operatorname{Beta}(3,2)\) and \(X=2.5+2.5Y\) g/dL. For this beta distribution, the cumulative distribution function is \(F_Y(y)=4y^3-3y^4\). If the uniform draws are \(0.1792,\;0.4752,\;0.8192\), the corresponding beta quantiles are \(0.4,\;0.6,\;0.8\), since substituting each value into \(F_Y\) gives the stated uniform probability. Transforming back gives:
These draws respect the modeled interval. The interval is a feature of this chosen model; it should not be treated as a general biological guarantee unless the bounds are scientifically justified.
Assumptions, Diagnostics, and Alternatives
Parametric sampling is most defensible when the chosen distribution is a reasonable representation of the target covariate’s marginal shape and support. The target parameters should refer to a clearly defined population and measurement scale. Independently generating a covariate for each virtual individual assumes that individual draws follow the specified distribution without additional dependence or clustering being represented. If the target includes clinically important subgroups with different distributions, one overall distribution may not represent it adequately.
Before using simulated values in predictions, inspect whether the generated sample is consistent with the model and whether its values make clinical sense. Useful basic checks include the minimum and maximum, mean and standard deviation on the intended scale, selected quantiles, and the number of values outside any scientifically justified bounds. A histogram can reveal substantial skew, multiple modes, or tail behavior that a chosen family does not capture. These checks do not prove that the distribution represents the target population; that judgment depends on the evidence used to specify the model.
The main alternatives differ in what they assume. Empirical resampling uses observed covariate records and preserves their observed marginal shape, but is limited by the available records and cannot generate values not represented there. Parametric sampling provides a compact model and can generate values beyond observed records, but depends on the selected family and parameters. A normal model is simple and symmetric but has unbounded support. A lognormal model ensures positivity and allows right skew, but may still put too much or too little probability in the upper tail. A scaled beta model respects specified finite bounds, but can impose an unsuitable shape or artificial boundary behavior.
Transformations also require attention to units. A normal draw in kilograms cannot be used as if it were in pounds, and a log-scale parameter is not a clinical value on the original scale. For a deterministic unit conversion such as \(X_{\text{new}}=cX_{\text{old}}\), both the mean and standard deviation are multiplied by \(c\) when \(c>0\); the variance is multiplied by \(c^2\). Record the scale and units alongside the sampled covariate so that downstream model inputs are interpretable.
Name the covariate, target population, scale, units, and available distributional information.
Check support and shape, and convert target summaries to the parameter scale required by that family.
Use the stated sampling rule, then convert values to the model’s required scale and units.
Review sample summaries, quantiles, extremes, and any scientifically justified bounds before using the values.
Common Mistakes and Limitations
- Using the wrong scale. A lognormal \(\mu_{\log}\) is the mean of \(\log(X)\), not the arithmetic mean of \(X\). Convert parameters using the lognormal moment equations.
- Ignoring support. A normal distribution can generate negative values for a positive covariate. Consider whether another family is more defensible rather than silently treating every impossible draw as acceptable.
- Confusing a finite sample with its target. A finite simulated sample will not usually reproduce the specified moments exactly. Differences alone do not show that the sampling code is wrong.
- Assuming a good fit from matching two moments. Many distributions share a mean and variance but have different tails and shapes. Moment matching does not establish that the selected family is clinically appropriate.
- Applying a transformation without tracking units. Exponentiating a log-scale draw returns a value on the original scale, but the clinical unit must still be the one used to define the model.
Parametric sampling is limited by the information used to choose the distribution. A simple family can smooth over multimodality, subgroup differences, or unusual tails. Conversely, adding complexity without adequate evidence can make the simulation less transparent. State the assumptions explicitly and interpret results as conditional on them.
Check Your Understanding
Work through each question, then compare your reasoning with the solutions.
- A positive covariate is modeled as lognormal with arithmetic mean 50 units and \(CV=0.20\). Calculate \(\sigma_{\log}^2\) and \(\mu_{\log}\).
- A normal model is specified as \(X\sim N(12,3^2)\). What value results from the standard normal draw \(Z=-0.5\), and what are its units if the specified covariate is measured in hours?
- A covariate is scaled from the interval 0 to 10. Its target mean is 4 and target variance is 4. Find the beta parameters for the rescaled variable.
- Why does matching a simulated sample mean to the target mean exactly not provide a general test of whether the simulation is correct?
Solutions. (1) \(\sigma_{\log}^2=\log(1+0.20^2)=\log(1.04)=0.03922\). Then \(\mu_{\log}=\log(50)-0.03922/2=3.892\), to three significant figures. (2) \(X=12+3(-0.5)=10.5\) hours. (3) On the unit interval, \(m_Y=4/10=0.4\) and \(v_Y=4/10^2=0.04\). Thus \(k=0.4(0.6)/0.04-1=5\), giving \(a=2\) and \(b=3\). (4) A random finite sample is expected to vary around the target distribution, so its mean need not equal the target mean. Exact agreement could occur by chance or by an imposed adjustment, and neither alone establishes that the distribution family, spread, tails, or sampling procedure is appropriate.