BayesMultiMode: Bayesian Mode Inference in R

Nalan Basturk, Jamie Cross, Peter de Knijff, Lennart Hoogerheide, Paul Labonne, Herman K. van Dijk

Main Article Content

Abstract

Multimodal univariate distributions arise in many fields such as astrophysics, bioinformatics, climatology and economics due to the heterogeneity of the underlying populations. Mixture processes are a popular tool for accurate approximation of such distributions and implied mode detection. Using Bayesian univariate mixture models and methods, BayesMultiMode estimates posterior probabilities of the number of modes, their locations and uncertainty, yielding a powerful tool for mode inference. The approach follows Cross, Hoogerheide, Labonne, and Van Dijk (2024) and works in two stages. First, a flexible mixture with an unknown number of components is estimated using a Bayesian Markov chain Monte Carlo (MCMC) method due to Malsiner-Walli, Frühwirth-Schnatter, and Grün (2016). Second, suitable detection algorithms are employed to estimate modes for continuous and discrete probability distributions. Given these mode estimates, posterior probabilities for the number of modes, their locations and uncertainties are constructed. BayesMultiMode supports a range of mixture processes, complementing and extending existing software for mixture modeling. The mode detection algorithms implemented in BayesMultiMode also support MCMC draws for mixture estimation generated with external software. The package uses for illustrative purposes both continuous and discrete empirical distributions from the four listed fields yielding reliable multiple mode detection with substantial posterior probability where frequentist tests fail to reject the null hypothesis of unimodality.

Article Details

Article Sidebar