Why Marginal Distributions Matter
A simulation can contain the intended shared signals and cross-omics associations yet still be unrealistic if its individual measurements have the wrong scale or shape. For example, a continuous assay may be positive and strongly right-skewed, a count assay may have many small values and a long upper tail, and a composition must sum to one. Replacing all of these with normally distributed values can produce impossible measurements and misrepresent the extreme observations that affect many analysis methods.
Here, the goal is to match each feature’s marginal distribution: the distribution of that feature considered by itself, without specifying its joint relationship with other features. For subject \(i\), feature \(j\), and modality \(m\), write the measurement as \(X_{ij}^{(m)}\). A target marginal \(F_j^{(m)}\) describes the distribution intended for that feature across subjects. Matching these targets is one component of simulation design, not a substitute for the cross-omics dependence considered in the earlier material on Simulating Cross-Omics Dependence.
A useful target is more specific than “realistic.” State the measurement scale, allowable values, and quantities to be matched. These may include the mean and variance, selected quantiles, proportion of zeros, and a scientifically plausible upper range. If targets are estimated from a reference data set, acknowledge that they inherit its sampling uncertainty and any preprocessing choices. A target distribution should represent the measurement process of interest, not merely be convenient to simulate.
Choosing and Generating Marginals
Distribution choice begins with the measurement’s support and sampling mechanism. A positive, right-skewed continuous measurement may be described by a lognormal model. Counts require distributions on the nonnegative integers; a Poisson model has equal mean and variance, whereas a negative-binomial model can allow overdispersion. Compositional measurements lie on a simplex, so their components are constrained to sum to one. Zero-inflated counts require a model that distinguishes an additional zero-generating process from the count distribution among observations not in that process.
For a continuous target, this construction gives an exact model-based marginal in repeated simulation, up to numerical implementation. For a discrete target, the cumulative probability jumps create ties, as they should. A finite simulated block will not have exactly the target mean, variance, or quantiles: random variation remains. The purpose of diagnostics is to decide whether discrepancies are ordinary finite-sample variation or evidence of an incorrect model, parameter, transformation, or implementation.
Worked Example: A Positive, Right-Skewed Continuous Feature
Suppose a hypothetical continuous assay feature is to have mean \(5\) units and log-scale variance \(\sigma_L^2=\log(2)\). Use a lognormal model: \(\log X\sim N(\mu_L,\sigma_L^2)\). This assumes strictly positive values and approximately normal variation on the log scale; it does not assert that every continuous assay should be lognormal.
For this parameterization, \(E(X)=\exp(\mu_L+\sigma_L^2/2)\). Setting this equal to \(5\) gives
The variance on the measurement scale is \(E(X)^2\{\exp(\sigma_L^2)-1\}=25(2-1)=25\) square units, so the standard deviation is \(5\) units. The median is \(\exp(\mu_L)\approx3.536\) units. With \(z_{0.95}\approx1.645\), the target 95th percentile is calculated using the unrounded parameters:
As a finite-simulation diagnostic, suppose a hypothetical block of 1,000 generated values has mean \(5.08\) units, median \(3.51\) units, and empirical 95th percentile \(13.72\) units. These are reasonably close to the targets \(5\), \(3.536\), and \(13.91\), respectively, but the agreement is not exact and should not be described as exact matching. Inspect a histogram or quantile plot as well: matching these three summaries alone would not rule out a badly distorted distribution between them or in the far tail.
Worked Example: An Overdispersed Count Feature
Consider a hypothetical count feature generated from a negative-binomial distribution parameterized by mean \(\mu=8\) counts and dispersion \(k=4\). Under this parameterization, \(E(X)=\mu\), \(\operatorname{Var}(X)=\mu+\mu^2/k\), and \(P(X=0)=\{k/(k+\mu)\}^{k}\). The model assumes nonnegative integer values and allows variance greater than the mean.
The target variance and zero probability are
Suppose 500 simulated values have mean \(8.14\) counts, variance \(23.1\) counts squared, and 7 zeros. The empirical zero fraction is \(7/500=0.0140\), or \(1.40\%\), close to the model target of \(1.235\%\). The sample mean and variance are also close to their targets of 8 and 24. This is compatible with reasonable finite-sample variation, but these three checks do not prove that the upper tail is appropriate. Compare additional quantiles, and verify that simulated values are integers and never negative. A Poisson model would impose variance \(8\), so it would fail to represent the target overdispersion in this example.
Worked Example: A Compositional Feature Block
Suppose a hypothetical measurement records three component proportions per subject. A Dirichlet model with parameter vector \((2,3,5)\) assumes all components are positive and sum to one. The total parameter is \(\alpha_0=2+3+5=10\). The expected proportions are \(\alpha_j/\alpha_0\), giving targets \(0.20,\ 0.30,\ 0.50\).
For a Dirichlet component \(X_j\), the marginal distribution is beta with parameters \(\alpha_j\) and \(\alpha_0-\alpha_j\). Thus \(X_1\) has a \(\text{Beta}(2,8)\) marginal, and its variance is
A valid generated subject might have proportions \((0.12,0.28,0.60)\). Their sum is \(1.00\), as required. For a small hypothetical block of three subjects with compositions \((0.12,0.28,0.60)\), \((0.25,0.35,0.40)\), and \((0.18,0.22,0.60)\), the component-wise sample means are \(0.1833,\ 0.2833,\ 0.5333\), which sum to \(1.000\). Their differences from the targets are unsurprising for only three draws. A Dirichlet model excludes exact zeros; if zeros are substantively part of the target, this model alone is inadequate. Also, the sum constraint means the components cannot vary independently: checking each marginal does not remove this compositional dependence.
Worked Example: A Zero-Inflated Count
Suppose a hypothetical count feature has an extra-zero probability \(\pi=0.30\). With probability \(\pi\), the value is zero; otherwise it follows a negative-binomial distribution with mean \(\mu=4\) and dispersion \(k=2\). This mixture assumes that the additional zero mechanism is meaningful for the simulation and that the non-extra-zero component follows the stated negative-binomial model.
The negative-binomial component has variance \(4+4^2/2=12\) and zero probability \(\{2/(2+4)\}^2=1/9\). The overall zero probability and mean are therefore
The second moment is \(E(X^2)=0.70(12+4^2)=19.6\), so the overall variance is \(19.6-(2.80)^2=11.76\) counts squared. In a hypothetical block of 900 values with 349 zeros, the observed zero fraction is \(349/900\approx0.3878\), close to \(0.3778\). An overall sample mean of \(2.78\) counts would likewise be close to the target \(2.80\). Check the zero fraction separately from the distribution of positive counts: an overall mean can look right even when the model generates too many zeros and compensates with overly large positive values.
Checking Marginal Fit and Diagnosing Failure
Choose diagnostics before generating the block, based on the target and the intended use of the simulation. A compact diagnostic set often includes the minimum and maximum, mean and standard deviation where meaningful, selected quantiles such as the median and 95th percentile, and a histogram or empirical distribution plot. For counts, add the zero fraction and integer/nonnegative checks. For compositions, verify that each row is nonnegative and sums to one within numerical tolerance, then inspect component distributions. Compare the diagnostics with the target values, not with vague expectations such as “the values look plausible.”
Interpret discrepancies in context. An empirical 95th percentile far above its target may indicate a tail that is too heavy, a parameterization error, or simply a rare finite-sample fluctuation; inspect repeated simulation blocks or a wider set of quantiles before deciding. A negative value from a model intended to produce positive measurements indicates a support error, not harmless sampling noise. An unexpectedly high count zero fraction may indicate an unsuitable count model or a coding error. For compositions, row sums that differ materially from one signal a generation or normalization problem.
For every feature type, record the support, target summaries or distribution, relevant tail behavior, and any structural zeros or constraints.
Use a distribution and parameterization that satisfy the support and target properties. Check parameter conversions algebraically before generating values.
Check implementation constraints, then compare empirical summaries and distribution plots with their targets. Investigate large or systematic discrepancies rather than forcing a single random block to match exactly.
Assess marginal fit separately from dependence. If a simulation construction applies transformations to obtain target marginals, check that it has not unintentionally changed the joint properties required by the benchmark.
One useful justification for the last step concerns strictly increasing transformations. If \(Z\sim N(0,1)\) and \(X=F^{-1}\{\Phi(Z)\}\), where \(\Phi\) is the standard normal cumulative distribution function and \(F\) is a continuous target distribution, then \(X\) has marginal distribution \(F\). Indeed, for any \(x\) in the support,
The last equality follows because \(Z\) is standard normal. This establishes the marginal result, not that every dependence measure is preserved. Monotone transformations preserve the ordering of values within each feature, but generally change Pearson correlations. Discrete targets introduce ties, which can further alter rank-based dependence. Thus, a procedure that matches marginals must still be checked against the intended joint structure.
Alternatives, Limitations, and Common Pitfalls
| Approach | Strength | Limitation to check |
|---|---|---|
| Parametric generation | Compact specification; supports simulation beyond observed values. | A wrong family or parameterization can distort support, central shape, or tails. |
| Empirical resampling | Retains the observed marginal shape without choosing a parametric family. | Cannot generate values beyond the observed range and reproduces features of the reference sample, including its noise. |
| Marginal quantile mapping | Can transform generated values to specified continuous marginal distributions. | May change dependence measures; discrete targets create ties, and extrapolation beyond observed quantiles requires a rule. |
No method makes the target distribution objectively “realistic” without a defensible target. A parametric model may be useful for stress-testing tails, but that does not establish that its tail is empirically plausible. Empirical resampling avoids some distributional assumptions but is limited by the reference data’s range and size. Quantile matching can reproduce chosen marginals while leaving important joint behavior misspecified. The right choice depends on the benchmark question and should be reported with the distributional assumptions and diagnostics.
- Confusing a marginal with a joint model. Correct per-feature histograms do not imply realistic cross-feature relationships. Diagnose both separately.
- Matching only the mean. Equal means can hide different skewness, zero rates, or upper tails. Check quantities that matter for the method comparison.
- Using a distribution with the wrong support. A normal model can generate negative values for a strictly positive assay, and a continuous model cannot represent integer counts exactly.
- Forcing exact finite-sample agreement. A random sample will fluctuate around its target. Altering generated observations to hit every target summary can change the intended distribution and must be justified as part of the design.
- Ignoring transformations and constraints. Log transformations, normalization, and compositional closure affect the scale and dependence of the measurements. State whether targets apply before or after such processing.
The central practical principle is to define the marginal target on the scale that the simulated analysis will receive, then verify support, central summaries, zero behavior, and tails. Matching only one of these features can yield data that look plausible at a glance but behave unlike the intended measurements.
Check Your Understanding
Answer each question, then compare with the brief solutions below.
- A positive feature is simulated from a lognormal distribution with \(\log X\sim N(\mu_L,\sigma_L^2)\). Which quantity determines the median, and which determines the log-scale spread?
- A count target has mean \(6\) and variance \(6\). Which standard count model is compatible with those two moments, and what limitation does that choice impose?
- Why can three component-wise marginal distributions that each appear reasonable still fail to describe a valid compositional block?
- A zero-inflated count simulation matches its target mean but has a much larger zero fraction. Name one useful diagnostic and explain why the mean alone is insufficient.
Solutions. (1) The median is \(\exp(\mu_L)\); the log-scale standard deviation is \(\sigma_L\), and log-scale variance is \(\sigma_L^2\). (2) A Poisson model has variance equal to its mean, so it is compatible with these moments; that equality limits it when the target is overdispersed. (3) Valid compositions must be nonnegative and sum to one for each subject, imposing a joint constraint that separate marginal checks do not ensure. (4) Check the empirical zero fraction against its target. The mean can agree despite too many zeros if positive values are correspondingly larger, so zero frequency and positive-count behavior require separate checks.