Computing the Dirichlet-Multinomial Log-Likelihood Function

Djallel BouneffoufarXiv 2020

Abstract

The Dirichlet-Multinomial (DMN) distribution is widely used to model over-dispersed count data in fields such as bioinformatics and natural language processing. However, standard numerical implementations of its log-likelihood function are often computationally expensive or numerically unstable. This paper introduces "ExactDMN," a method that utilizes the recursive properties of the Gamma function to derive a closed-form expression for the log-likelihood. ExactDMN is shown to be significantly faster and more stable than existing approximation-based methods, particularly for large-scale datasets.

Introduction

In many scientific applications, count data exhibit variance that exceeds the predictions of a standard Multinomial distribution. The Dirichlet-Multinomial (DMN) distribution is the standard solution for modeling this over-dispersion. However, its log-likelihood function depends on the Gamma function ($\Gamma$), which is computationally taxing to evaluate directly. Existing high-accuracy approximations, such as the "Mesh" algorithm, rely on complex polynomials that scale poorly with total observation counts. Furthermore, conventional implementations can be numerically unstable, often returning "NaN" errors when parameters approach zero.

Methodology

ExactDMN addresses these challenges by shifting from numerical approximation to an exact derivation. The core of the method is the recursive definition of the Gamma function: $\Gamma(n) = (n-1)\Gamma(n-1)$. By applying this property to the ratios of Gamma functions in the DMN probability mass function, the log-likelihood can be expressed as a series of simple log-summations:

$$\log(L(\alpha, x)) = \sum_{k=1}^K \sum_{j=\alpha_k}^{\alpha_k+x_k-1} \log(j) - \sum_{i=A}^{A+N-1} \log(i)$$

This formulation avoids the need for Bernoulli polynomials or complex mesh-based approximations. As shown in Table 1, ExactDMN's computational complexity scales linearly with the counts ($x_k$ and $N$), providing a significant theoretical advantage over the Mesh and VGAM implementations.

Table 1: Comparison of computational complexity across different DMN methods.

Evaluation

The performance of ExactDMN was benchmarked against the VGAM library and the Mesh algorithm using simulated datasets designed to mimic high-count scenarios in deep sequencing. Accuracy was evaluated with parameters $x = n(1, 1, 1, 1)$, $\phi = 1/200$, and $p = (0.1, 0.2, 0.3, 0.4)$. Runtime performance was measured using $x = n(1, 2, 3)$, $p = (1/6, 1/3, 1/2)$, and $\phi = 1/60$.

Results

ExactDMN demonstrates superior performance in both accuracy and efficiency. It maintains the high precision of the Mesh algorithm (with errors as low as $10^{-14}$) while avoiding the numerical fluctuations observed in the standard VGAM implementation.

In runtime comparisons, ExactDMN (labeled as GDMN in the results) was approximately twice as fast as the Mesh algorithm. Notably, its runtime grows much more slowly as the total count $n$ increases, making it exceptionally well-suited for "big data" applications.

Figure 1: Runtime comparison between Mesh and ExactDMN (GDMN).

Conclusion

ExactDMN provides a simpler, faster, and more stable approach to computing the Dirichlet-Multinomial log-likelihood. By leveraging fundamental mathematical properties, it eliminates the overhead and instability associated with traditional approximation methods. Future work will focus on validating the algorithm with real-world genomic datasets and exploring its scalability in extremely high-dimensional spaces.

Summary updated

BibTeX
@misc{bouneffouf2020computing,
  author = {Djallel Bouneffouf},
  title = {{Computing the Dirichlet-Multinomial Log-Likelihood Function}},
  year = {2020},
  eprint = {2007.11967},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.11967},
}
Figure