Why Model Donor-Level Compositions?
A donor-level cell-type composition records the fractions of a donor’s analyzed cells assigned to each of \(K\) cell types. These fractions are linked: they are nonnegative and sum to one. As the earlier material on compositional data establishes, a change in one fraction necessarily changes at least one other fraction. Dirichlet regression provides a probability model for strictly positive compositions and allows their expected proportions to depend on donor covariates.
The response is a vector, not a collection of unrelated proportions. Modeling its components jointly respects the sum-to-one constraint. The model also makes a strong distributional commitment: conditional on covariates, the composition follows a Dirichlet distribution with a particular covariance structure. That commitment is useful when appropriate, but it should be checked against the study design and data.
The standard Dirichlet density, with respect to the usual \(K-1\)-dimensional measure on the simplex, is
Here \(\Gamma(\cdot)\) is the gamma function. This is a density, not the probability of observing one exact composition. Conditional independence across donors is ordinarily assumed. The observed donor compositions must have the same defined components and denominator interpretation; the model does not itself account for repeated measurements or dependence between donors.
Linking Covariates to the Mean Composition
A common specification uses reference-category log-ratio links. Choose cell type \(K\) as the reference, and let \(x_i\) be a vector of donor-level predictors, usually including an intercept. For \(k=1,\ldots,K-1\), specify
The reference component has linear predictor zero. Equivalently, all \(K\) mean components are calculated together by the softmax formula
The coefficient for a predictor describes a change in the log ratio of a component’s conditional mean to the reference component’s conditional mean. It is not, by itself, a percentage-point change in that cell type. Because the mean components must sum to one, changing one linear predictor generally changes several predicted proportions.
Worked Example: Translating Treatment Coefficients Into a Composition
Suppose there are three cell types, with type 3 as the reference, and a binary treatment predictor \(x\), coded 0 for control and 1 for treatment. Consider the hypothetical fitted equations $$ \log(\mu_1/\mu_3)=\log(2)-\log(2)x, \qquad \log(\mu_2/\mu_3)=\log(2)+\log(3)x. $$
Control, \(x=0\). The two reference ratios are \(\mu_1/\mu_3=2\) and \(\mu_2/\mu_3=2\). The unnormalized proportions are therefore \((2,2,1)\), whose sum is 5. Normalizing gives $$ \mu(0)=(2/5,2/5,1/5)=(0.400,0.400,0.200). $$
Treatment, \(x=1\). The first ratio is \(\exp(\log(2)-\log(2))=1\); the second is \(\exp(\log(2)+\log(3))=6\). The unnormalized proportions are \((1,6,1)\), whose sum is 8. Thus $$ \mu(1)=(1/8,6/8,1/8)=(0.125,0.750,0.125). $$
The type 1 coefficient of \(-\log(2)\) means that its mean ratio to type 3 is multiplied by \(1/2\) under treatment, holding the model’s other predictors fixed. It does not mean type 1 falls by one half of its control percentage. In these predictions, type 1 falls by 0.275, or 27.5 percentage points, while type 2 rises by 0.350, or 35.0 percentage points.
More generally, for a continuous predictor \(x_r\), let \(\beta_{kr}\) be its coefficient for component \(k<K\), and define \(\beta_{Kr}=0\). Differentiating the softmax mean gives
This follows by differentiating the numerator and denominator of the softmax expression. The term subtracted from \(\beta_{kr}\) is the composition-weighted average coefficient across components. Thus the mean’s response depends on all component coefficients and the current composition, not just on the coefficient for the component being discussed.
Precision, Variability, and Fitting
Under the stated parameterization, the conditional mean and covariance are
At a fixed mean composition, larger precision means less donor-to-donor variation under the model. The negative covariance is a consequence of the constrained sum: when one component is higher, the remaining components together must be lower. This covariance structure is restrictive; it does not allow arbitrary patterns of dependence among components.
Worked Example: Interpreting Dirichlet Precision
Suppose a hypothetical model predicts mean composition \((0.200,0.300,0.500)\) for a covariate profile and uses precision \(\phi=20\). For cell type 1, the conditional variance is $$ \operatorname{Var}(Y_1\mid x) = \frac{0.200(1-0.200)}{20+1} = \frac{0.160}{21} = 0.007619. $$
The corresponding conditional standard deviation is \(\sqrt{0.007619}=0.08729\), or about 8.73 percentage points of composition. The covariance between types 1 and 2 is $$ \operatorname{Cov}(Y_1,Y_2\mid x) = -\frac{0.200(0.300)}{21} = -0.002857. $$
These quantities describe variation across hypothetical donors conditional on the model and covariates; they are not standard errors for the estimated mean. A larger \(\phi\) would reduce the conditional variance while leaving the mean composition unchanged.
A typical model uses a common precision \(\phi\) and estimates the regression coefficients by maximizing the donor-level log-likelihood
The \(\mu_{ik}\) in this expression are functions of the covariates and regression coefficients through the link. Precision may instead be modeled with its own positive link when the application supports that additional complexity. The fitting procedure requires interior responses, a specified set of components and reference category, and a model that is identifiable from the available donor covariates. Very few donors, highly correlated predictors, or near-constant compositions can make estimates unstable.
Worked Example: Evaluating a Dirichlet Density
For one hypothetical donor, suppose the observed interior composition is \(y=(0.25,0.50,0.25)\), and the model assigns this covariate profile mean \(\mu=(0.25,0.50,0.25)\) and precision \(\phi=8\). The Dirichlet parameters are \(\alpha=(2,4,2)\). Substitution into the density gives $$ f(y) = \frac{\Gamma(8)}{\Gamma(2)\Gamma(4)\Gamma(2)} (0.25)^{2-1}(0.50)^{4-1}(0.25)^{2-1} = \frac{5040}{1\cdot6\cdot1}(0.25)(0.125)(0.25) = 840(0.0078125) = 6.5625. $$
A density value greater than 1 is permissible; densities are not probabilities. The value describes the density at that point relative to the simplex measure. It is not the probability that this donor has exactly the displayed proportions.
Zero Proportions and Model Limitations
The standard Dirichlet distribution assigns probability one to strictly positive compositions and probability zero to the boundary, where any component is exactly zero. Therefore, a donor-level proportion vector containing an observed zero is not an ordinary observation in the support of this regression. The density formula includes \(\log(y_{ik})\), which is undefined at zero; depending on the corresponding Dirichlet parameter, the density may approach zero or diverge near that boundary, but neither behavior makes a boundary observation an interior draw with positive probability.
A zero proportion can arise because a cell type was not observed among a finite number of sampled cells, or because the type is genuinely absent under the sampling and biological process. Those cases have different implications. The earlier material on zero counts and rare cell types is relevant when deciding which interpretation is plausible. Adding a small pseudocount or replacing zero with a positive value may permit a numerical fit, but changes the data and can affect estimated means and coefficients; any such procedure requires explicit justification and sensitivity analysis.
The Dirichlet regression is most defensible when donor-level proportions are interior, the donor is the independent unit, the components form a coherent composition, and the Dirichlet’s mean-precision and covariance assumptions are plausible. It can be poorly suited when the data contain many zeros, strong extra variation, or dependence patterns that do not match its constrained covariance. Diagnostics include checking that all input compositions are positive and sum to one, examining fitted and observed component distributions, and looking for systematic mismatch across covariate profiles. A numerical optimizer’s convergence alone does not establish that the probability model is adequate.
| Approach | What it models | Important distinction |
|---|---|---|
| Dirichlet regression | A strictly positive composition with a covariate-dependent mean and precision | Uses a constrained covariance pattern and cannot directly accommodate observed zeros |
| Logistic-normal regression | Log-ratio coordinates with a multivariate normal model | Can allow more flexible dependence among log-ratios, but its ordinary inverse-log-ratio composition is also strictly positive |
| Count-based models | Observed counts, with their sampling information retained | Can represent zero observed counts; the likelihood and interpretation differ from regression on continuous donor proportions |
These are not interchangeable likelihoods. Dirichlet regression treats the donor’s proportions as continuous composition outcomes. When cell counts and their denominators are central to the inferential question, a model for counts may be preferable. Conversely, the Dirichlet formulation can be convenient when the target is variation in donor-level compositions and all observed proportions are interior. Neither choice turns an observational covariate association into a causal effect.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- In a three-component model with component 3 as reference, what does a slope of \(\log(2)\) for a treatment predictor mean for the ratio \(\mu_1/\mu_3\)?
- For \(\mu=(0.4,0.6)\) and \(\phi=9\), calculate the Dirichlet variance of the first component.
- Why is it incorrect to interpret a Dirichlet regression coefficient as a percentage-point change in a cell type?
- A donor’s observed composition is \((0,0.7,0.3)\). Can the standard Dirichlet regression use this vector directly? Explain one limitation of replacing the zero with a small positive number.
Solutions. (1) Holding other predictors fixed, treatment multiplies \(\mu_1/\mu_3\) by \(\exp(\log(2))=2\); the coefficient does not specify an absolute proportion change. (2) The variance is \(0.4(1-0.4)/(9+1)=0.24/10=0.024\). (3) The coefficient acts on a log ratio, while the softmax normalization makes each predicted component depend on all component predictors and the current composition. (4) No. The vector is on the boundary, outside the standard Dirichlet’s strictly positive support. Replacing zero changes the observed composition and can alter fitted results, so conclusions may depend on the chosen replacement and should be assessed for sensitivity.