Abstract
Observed data from many research disciplines, ranging from cellular biology to economics, often follow a particular long-tailed distribution known as a power law. Despite the ubiquity of natural power laws, inferring the exact form of the distribution from sampled data remains challenging. The possible presence of multiple generative processes giving rise to an unknown weighted mixture of distinct power law distributions in a single dataset presents additional challenges. We present a probabilistic solution to these issues by developing a Bayesian inference approach, with Markov chain Monte Carlo sampling, to accurately estimate power law exponents, the number of mixtures, and their weights, for both discrete and continuous data. We determine an objective prior distribution that is invariant to reparameterization of parameters, and demonstrate its effectiveness to accurately infer exponents, even in the low sample limit. Finally, we provide a comprehensive and documented software package, written in Python, of our Bayesian inference methodology, freely available at https://github.com/AtwalLab/BayesPowerlaw.
Introduction
Power laws—distributions where the frequency of an event is inversely proportional to its size—are ubiquitous across biology, physics, and economics. However, "fitting" a power law to real-world data is notoriously difficult. While Maximum Likelihood (ML) estimation has long been the "gold standard," it suffers from three major flaws: it provides only point estimates without quantifying uncertainty, it performs poorly with small sample sizes ($N \approx 30$), and it typically assumes data originates from a single power law process. In reality, many datasets are "mixtures" of multiple generative processes, each with its own exponent.
Methods
The proposed Bayesian inference approach utilizes Markov Chain Monte Carlo (MCMC) sampling to address these limitations. A key technical innovation is the derivation of an objective Jeffreys prior that is invariant to parameterization. Interestingly, this non-informative prior for a power law is itself a power law, naturally favoring exponents near 1, consistent with Zipf’s Law.
To enhance efficiency, the framework employs a modified "burn-in" phase that accepts moves only if they increase likelihood, rapidly steering the algorithm toward the correct parameter range. Furthermore, the model can estimate the number of distinct power laws in a single dataset, their individual exponents, and their relative weights using the Bayesian Information Criterion (BIC) for model selection.
Empirical Analysis
The model was validated using 16 diverse empirical datasets spanning literature, biology, and social systems. These include word frequencies in novels like Moby Dick, T cell clone sizes, and social media metrics such as likes per tweet.
Results
The Bayesian approach demonstrates significant advantages over traditional methods, particularly in the "small data" regime. While Bayesian means match ML results in large sample limits, the Bayesian estimates remain stable where ML deviates wildly at low sample sizes.
A major finding was the identification of hidden mixtures in biological data. For instance, T cell clone size distributions were revealed to be mixtures of two distinct power laws, likely representing "naive" versus "proliferative" cell populations.
Discussion
The study confirms that traditional linear regression on log-transformed data is highly inaccurate for small samples. The Bayesian framework, implemented in the open-source BayesPowerlaw Python package, provides a robust alternative that quantifies uncertainty and handles complex mixtures. Future work may focus on automating the detection of the lower bound ($x_{min}$) and improving sensitivity for mixtures with high exponents ($\gamma > 3$), where the "tails" of the distribution vanish quickly.
Summary updated