---
title: "powerlaw — paper by Alstott et al. (2014) · PLoS ONE"
description: "How powerlaw fits heavy-tailed data, selects a scaling range, compares alternative distributions, and exposes statistical assumptions."
canonical: "https://research.elamur.ai/free/en/papers/alstott-2014-powerlaw-python-package-analysis-heavy/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/alstott-2014-powerlaw-python-package-analysis-heavy/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2014](https://md.research.elamur.ai/free/en/papers/2014/) / powerlaw: A Python Package for Analysis of Heavy-Tailed Distributions

# powerlaw: A Python Package for Analysis of Heavy-Tailed Distributions

Paper · 2014 · Jeff Alstott, Edward Thomas Bullmore and Dietmar Plenz

**Authors:** [Jeff Alstott](https://md.research.elamur.ai/free/en/authors/jeff-alstott/), [Edward Thomas Bullmore](https://md.research.elamur.ai/free/en/authors/edward-thomas-bullmore/) and [Dietmar Plenz](https://md.research.elamur.ai/free/en/authors/dietmar-plenz/) · **Year:** 2014 · **Venue:** PLoS ONE · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

PLoS ONE · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/1305.0215)
- [DOI 10.1371/journal.pone.0085777](https://doi.org/10.1371/journal.pone.0085777)
- [arXiv 1305.0215](https://arxiv.org/abs/1305.0215)

## What it is about

How powerlaw fits heavy-tailed data, selects a scaling range, compares alternative distributions, and exposes statistical assumptions. · about 36 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

A few unusually large observations can dominate a dataset: exceptionally frequent words, highly connected neurons, or electricity failures affecting many people. A power law offers one possible description of such unevenness, but an impressive-looking tail is not enough to establish that description. The researcher must decide which observations belong to the relevant range, estimate the distribution’s parameters, and test plausible alternatives. Jeff Alstott, Ed Bullmore, and Dietmar Plenz introduce powerlaw to make that analysis easier to carry out correctly. Their contribution is a Python package that brings established statistical procedures into a coherent interface while exposing choices that depend on the scientific setting.

The package organizes analysis around a dataset and the candidate distributions fitted to it. It can display empirical probabilities, estimate a power-law exponent, search for the lower boundary of the scaling region, and compare competing explanations using likelihood ratios. It accommodates integer-valued observations, continuous measurements, upper bounds, parameter restrictions, and alternative fitting criteria. These options matter because apparently minor decisions can change the conclusion. For the electricity-blackout example, automatically selecting the lower boundary produces an exponent of 2.273 and a Kolmogorov–Smirnov distance of 0.061. Fixing that boundary at 1.0 instead gives an exponent of 1.220 and a distance of 0.376. The distance measures disagreement between the fitted distribution and the empirical observations; a smaller value indicates closer agreement under that criterion.

The examples also show why fitting a power law is only part of the investigation. For the neuronal connections of C. elegans, the comparison against an exponential distribution returns a likelihood ratio of 16.384 and a significance value of 0.024, supporting the power law over that alternative. Yet comparison with an exponentially truncated power law does not resolve whether the scaling eventually tapers off. For word frequencies in Moby Dick, the power-law versus lognormal comparison yields 0.928 and 0.426, leaving those descriptions statistically unresolved. Even a familiar example associated with [Zipf’s law](https://md.research.elamur.ai/free/en/concepts/zipfs-law/) therefore illustrates the limits of choosing a distribution from its visual appearance or reputation.

The central lesson is methodological. Researchers should distinguish a good-looking curve, an adequate fit over a selected range, and evidence favoring one explanation over another. They should also connect candidate distributions to plausible processes in the domain. When the data cannot separate competing descriptions, an experiment targeting their generating processes may be more informative than further curve fitting. Powerlaw supports this reasoning through accessible software, but the authors repeatedly emphasize that scientific judgment remains necessary: the package cannot infer an observation window, remove dependence between observations automatically, or turn an inconclusive comparison into a unique explanation.

### Ideas worth borrowing

Choose the scope before interpreting the fit. A statistical relationship may hold only over part of the observed range. Searching for that region makes the scope of the claim explicit, while recording the excluded observations prevents a local pattern from becoming a statement about the whole dataset. This principle transfers to performance analysis, corpus statistics, and [evaluation](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/), where behavior on common cases may differ from behavior on rare or extreme cases.

Compare explanations against credible alternatives. Evidence that one distribution resembles the observations does not establish that it is the most informative available description. Comparative testing asks a sharper question: which candidate accounts for the same observations more convincingly? The same approach helps evaluate linguistic rules, extraction procedures, and reasoning strategies, provided each alternative addresses a comparable task.

Let possible causes guide candidate selection. Searching an unrestricted collection of mathematical forms invites overfitting. A plausible generating process gives a reason to consider a candidate beyond its ability to trace the observed curve. This is useful whenever a researcher can propose several explanations for the same pattern, including word-frequency variation, network structure, and uneven computational workloads.

Expose approximation conditions. A faster calculation is useful only when its error is acceptable for the intended analysis. The paper distinguishes estimating a discrete exponent from generating discrete random observations, and gives different conditions for their accuracy. This encourages interfaces that record which approximation was used, its assumptions, and the setting in which it was checked.

Retain the search landscape. The selected answer can conceal other plausible solutions. Keeping the distances, parameter estimates, and uncertainties for all considered lower boundaries reveals whether the optimum is isolated or competes with another region. This idea applies to parameter tuning and rule induction: a result is easier to interpret when the alternatives that nearly won remain inspectable.

Treat visualization as an analytical choice. Bin spacing, normalization, and cumulative transformation can expose or conceal the behavior being investigated. A graph is therefore part of the measurement procedure, not merely its decoration. The transferable practice is to choose a display according to the question and check whether another representation changes the apparent pattern.

Make failure states visible. Numerical software can return values even when a requested constraint has not been satisfied or an optimizer has failed to find a valid solution. The package’s warning flag separates a returned value from a successful constrained fit. Any automated analytical system benefits from preserving that distinction, especially when later steps would otherwise treat a populated field as evidence of success.

### How Mova uses it

Mova is a small language system implemented in Rust, with explicit linguistic rules, statistical components, and retained evidence for many decisions. The connections below concern possible transfers of the paper’s analytical practices. The status marks describe proposed relationships to existing mechanisms; they do not establish that powerlaw has been integrated or that these transfers have improved Mova. A mark of “нове” identifies a proposed addition whose implementation is unestablished, instead of proving novelty from an incomplete account.

Idea: Choose a scaling region explicitly. Where: “Identifying the Scaling Range,” Figure 1B. Area: stats/data. Mova: нове. Mova could examine whether dictionary occurrence counts follow a proposed distribution only above a defensible frequency boundary. The report should distinguish the analyzed tail from the remaining vocabulary and retain the boundary-selection criterion. Why Mova: frequency-driven dictionary work would gain an explicit statement of where a statistical description applies, rather than extending a tail pattern to every lexical item. Implementation and effects are unknown.

Idea: Preserve externally justified boundaries. Where: “Identifying the Scaling Range.” Area: data/eval. Mova: частково є (source configurations and bounded imports in tools/dictindex). Existing index configurations already delimit admitted sources and imported portions. A statistical analysis could additionally distinguish a boundary selected from the observations from one imposed by collection conditions. Why Mova: a corpus limit and a fitted frequency threshold answer different questions, and recording their origins would help prevent misleading comparisons.

Idea: Compare credible alternative distributions. Where: “Comparing Candidate Distributions.” Area: stats/eval. Mova: нове. Dictionary frequencies, graph degrees, and worker durations could be compared against several scientifically motivated descriptions rather than labeled power-law-like after inspection. All candidates would need the same declared observation range. Why Mova: this would turn a suggestive shape into a testable comparison and reduce the chance of adopting a convenient explanation prematurely. No such distribution-comparison result is established.

Idea: Use an exponential alternative as a basic heavy-tail check. Where: “Comparing Candidate Distributions,” Figure 1C. Area: stats. Mova: нове. Before describing a workload or lexical-frequency tail as heavy-tailed, an analysis could test whether the proposed power law is distinguishable from an exponential description. Why Mova: claims about extreme events can influence storage and scheduling decisions, so they deserve a basic competing explanation. This would be an analytical check, not a guarantee about future extremes.

Idea: Let generating processes guide candidate selection. Where: “Generative Mechanisms.” Area: reasoning/stats. Mova: частково є (source-bound assumptions and checks in groupants). A statistical groupant could state why vocabulary accumulation, graph growth, or a worker’s execution process makes a particular family worth examining. Why Mova: Mova already emphasizes declared assumptions; linking each candidate to a proposed cause would make distribution analysis easier to review and discourage unrestricted curve searching.

Idea: Preserve an inconclusive comparison. Where: “Generative Mechanisms,” the word-frequency and neuronal examples. Area: eval/reasoning. Mova: частково є (gaps, explicit escalation, and typed complementary observations). A distribution report could retain several unresolved candidates rather than forcing a winner from the sign of a likelihood ratio. Why Mova: Mova’s transparent interfaces are well suited to expressing what evidence fails to distinguish. A dedicated statistical representation of this ambiguity remains unestablished.

Idea: Design an intervention when observations cannot separate explanations. Where: “Generative Mechanisms.” Area: eval. Mova: нове. If alternative accounts explain corpus growth or execution costs similarly, Mova could propose a controlled change in collection or workload that makes their predictions diverge. Why Mova: an informative new measurement may resolve uncertainty that repeated fitting cannot. This proposal concerns experimental design; automatic construction of such experiments is not demonstrated.

Idea: Distinguish integer counts from continuous measurements. Where: “Continuous vs. Discrete Data.” Area: math/stats. Mova: нове. Any future distribution-fitting module should carry the observation type explicitly, treating occurrence counts and elapsed durations according to their different supports. Why Mova: selecting a convenient continuous expression for integer observations can change the fit, so the type belongs in the analytical contract. Existing typed mathematics does not establish that this fitting distinction is implemented.

Idea: Record approximation identity and conditions. Where: “Discrete Distribution Calculation and Estimation.” Area: math/eval. Mova: частково є (exact and approximant execution profiles; typed approximants in combinatorial tooling). A distribution calculation could record whether it used an exact numerical search or a faster estimate, alongside the domain where agreement was assessed. Why Mova: this extends an existing distinction to statistical analysis without treating every accelerated computation as interchangeable.

Idea: Validate fitting approximations separately from sampling approximations. Where: “Discrete Distribution Calculation and Estimation.” Area: stats/eval. Mova: нове. A future statistical component should have separate checks for estimating parameters and generating synthetic observations, even when both operations use the same approximation option. Why Mova: success at recovering a parameter would not establish that a simulator produces the intended distribution. The paper provides a concrete reason to keep those validation obligations separate.

Idea: Make approximation defaults auditable. Where: “Discrete Distribution Calculation and Estimation,” the inheritance of sampling behavior. Area: other/software design. Mova: частково є (explicit execution modes and configuration identities). A returned statistical artifact could retain the effective approximation choice after defaults and inherited settings have been resolved. Why Mova: recursive use of a capability should preserve how its result was calculated, especially when callers do not supply every option themselves.

Idea: Use logarithmic bins for a sparse tail display. Where: “Visualization,” Figure 1A. Area: stats/data visualization. Mova: нове. Reports on dictionary occurrences or worker durations could offer logarithmically spaced, width-normalized bins when extreme values are sparse. Why Mova: the display could expose tail structure that many nearly empty equal-width bins obscure. It would remain a visualization choice, with no implication that the underlying data follow a power law.

Idea: Keep cumulative and density views complementary. Where: “Visualization,” Figures 2 and 3. Area: stats/data visualization. Mova: нове. A statistical report could provide both an unbinned cumulative view and a density view chosen for the analytical question. Why Mova: cumulative displays avoid bin choices, while density displays can reveal local peaks and clarify behavior near a declared upper boundary. Neither representation should automatically replace the other.

Idea: Separate the fitted subset from the original observations. Where: “Identifying the Scaling Range,” the original-data plotting option. Area: data/eval. Mova: частково є (actual imported-prefix reporting in tools/dictindex). A report could show the full observed frequency range alongside the subset used for estimation. Why Mova: visible exclusions would prevent an attractive tail fit from hiding low-frequency behavior or suggesting complete-corpus coverage when only a bounded import was analyzed.

Idea: Treat upper boundaries as collection metadata. Where: “Identifying the Scaling Range,” Figure 3. Area: data/stats. Mova: частково є (source/version evidence in tools/dictindex and tools/sources). A declared limit on imported documents or an observation window should accompany any analysis affected by that limit. Why Mova: a collection ceiling can shape a distribution without revealing the unrestricted process. The appropriate statistical treatment would still need to be established for each dataset.

Idea: Test whether conclusions survive a changed observation window. Where: “Identifying the Scaling Range,” the finite-size discussion. Area: eval. Mova: нове. Analysts could compare distributional conclusions across deliberately varied corpus or execution-observation windows, while preserving exact source versions. Why Mova: this could distinguish a persistent relationship from a pattern produced by a particular collection boundary. No such finite-size study is reported for Mova.

Idea: Retain competing local optima. Where: “Multiple Possible Fits,” Figure 5. Area: stats/interpretability. Mova: частково є (logged experimental branches in self-study and self-play). A statistical search could preserve every considered lower boundary together with its distance, exponent, and uncertainty. Why Mova: the selected result would become explainable in relation to nearby alternatives, especially when a constraint changes the winner. The existing journals do not establish this particular diagnostic.

Idea: Report fit quality and parameter uncertainty separately. Where: “Restricted Parameter Range” and “Multiple Possible Fits.” Area: stats/eval. Mova: частково є (confidence diagnostics in prag/src/eval.rs). Distribution reports could distinguish agreement with observations from uncertainty in the estimated parameters. Why Mova: a closely matching tail can still yield an imprecise exponent, and collapsing those properties into a single confidence label would obscure the tradeoff. Existing pragmatic confidence checks concern a different task.

Idea: Distinguish filtering candidate ranges from constraining their fits. Where: “Restricted Parameter Range.” Area: math/software design. Mova: нове. A future API could represent a rule that rejects uncertain lower boundaries separately from a rule that restricts parameter values during optimization. Why Mova: these operations alter different parts of the search, so explicit types would make their consequences easier to explain and reproduce.

Idea: Represent coupled constraints explicitly. Where: “Restricted Parameter Range,” the relative-error condition. Area: math/reasoning. Mova: частково є (typed constraints and invariants in groupants). Statistical admission could depend on a relationship between parameters rather than independent bounds alone. Why Mova: a constraint such as uncertainty relative to an estimated quantity may express the scientific requirement more faithfully. A corresponding statistical solver and its checks remain unestablished.

Idea: Never equate a returned estimate with satisfied requirements. Where: “No Possible Fits.” Area: eval/operational reliability. Mova: вже є (admitted-result boundaries in docs/hybrid-system.md and staged-result checks in tools/enrich). The same principle should govern any future fitting adapter: preserve whether constraints were satisfied, relaxed, or not solved. Why Mova: downstream work already depends on explicit admission, so statistical outputs should participate in that contract.

Idea: Preserve numerical-search failure separately from scientific rejection. Where: “No Possible Fits,” the constrained lognormal example. Area: stats/software design. Mova: частково є (explicit worker failures and retained diagnostic outcomes). An optimizer that cannot reach a feasible region should report that difficulty without declaring the candidate scientifically impossible. Why Mova: a bad starting point and evidence against a hypothesis require different next actions. A dedicated distinction for statistical optimization is not documented.

Idea: Retain initialization as part of an optimization receipt. Where: “No Possible Fits,” the revised initial-parameter example. Area: other/reproducibility. Mova: нове. A numerical fitting receipt could store the starting parameters together with constraints and convergence status. Why Mova: the paper shows that initialization can determine whether a constrained search succeeds, making it relevant evidence rather than an incidental implementation detail.

Idea: Check independence at the level of the observations. Where: “Maximum Likelihood and Independence Assumptions.” Area: stats/eval. Mova: частково є (sentence resampling in treeagree and verb resampling in wordgraph evaluation). Before likelihood-based analysis of tokens, sentences, or graph events, a report could declare which units may share a source of dependence. Why Mova: existing evaluations already recognize clustered observations, but their resampling choices do not automatically validate a new likelihood calculation.

Idea: Document any decorrelation procedure. Where: “Maximum Likelihood and Independence Assumptions,” the geographic illustration. Area: data/stats. Mova: нове. If observations are thinned to reduce dependence, Mova could retain the selection rule and the excluded units. Why Mova: removing correlated evidence changes the dataset and may alter coverage, so the transformation deserves the same provenance as source admission. Whether thinning is appropriate would depend on the task.

Idea: Do not transfer a remedy beyond its demonstrated scope. Where: “Maximum Likelihood and Independence Assumptions,” the minimum-distance alternative. Area: reasoning/eval. Mova: частково є (scope-bound checks and evidence in groupants). A fitting adapter could state that changing the estimation objective leaves the assumptions of a later likelihood-ratio test unresolved. Why Mova: this is a useful instance of Mova’s broader requirement that each transition have its own assumptions and failure behavior.

Idea: Make the distance criterion part of the result. Where: “Selecting x min with Other Distance Metrics.” Area: stats/eval. Mova: нове. A tail-selection report could retain whether its boundary was chosen using Kolmogorov–Smirnov, Kuiper, or Anderson–Darling distance. Why Mova: the criterion affects which discrepancies matter and how much data survives, so it should be visible whenever results are compared.

Idea: Match a metric’s sensitivity to the question. Where: “Selecting x min with Other Distance Metrics.” Area: stats/eval. Mova: частково є (multiple diagnostics in parser audits and confidence evaluation). An analytical extension could examine whether a default metric understates the particular errors of interest. Why Mova: a tail-focused question may require a different diagnostic emphasis, while the paper also warns that stronger tail sensitivity can leave too little evidence.

Idea: Correct comparisons for nested candidates. Where: “Nested Distributions.” Area: stats/math. Mova: нове. A future distribution registry could declare when one candidate is a special case of another and choose the corresponding significance calculation. Why Mova: structural relationships between candidates affect the interpretation of a comparison; treating every pair identically would discard information that can be represented explicitly.

Idea: Validate estimators with synthetic observations. Where: “Creating Simulated Data” and Figure S1. Area: eval/math. Mova: частково є (owned fixtures, negative controls, and explicit conformance checks). A statistical module could generate observations from known parameters and test what its fitting procedure recovers. Why Mova: known answers make certain implementation errors observable, while the resulting validation must remain separate from claims about real corpus data.

Idea: Explain one-sided recovery error caused by the setup. Where: Figure S1. Area: eval/data. Mova: нове. Synthetic evaluation reports could state when the construction of a dataset makes an error possible only in one direction. Why Mova: a boundary estimate may look biased partly because the test supplies no observations on the other side. Recognizing that restriction would improve interpretation without excusing unrelated fitting failures.

Idea: Reuse analytical context across candidate descriptions. Where: the introduction to Fit and Distribution objects; “The Utility and Future of powerlaw.” Area: other/software design. Mova: частково є (shared document graphs for mice and explicit capability interfaces). A Rust statistical component could retain the observations and analysis range in a common context while fitting several distributions through a consistent interface. Why Mova: shared context would reduce accidental differences between comparisons and keep each candidate’s output inspectable.

Idea: Add candidate families through a narrow extension interface. Where: “The Utility and Future of powerlaw.” Area: code/architecture. Mova: частково є (domain traits and configured handlers). New distributions could implement a declared statistical interface rather than duplicating data handling and reporting. Why Mova: this resembles Mova’s existing modular direction, but each added candidate would still need numerical checks and a scientific reason for inclusion.

Idea: Calculate expensive candidate fits when requested. Where: “Comparing Candidate Distributions,” the description of constituent distributions. Area: other/efficiency. Mova: нове. A statistical context could prepare shared observations once and defer candidate-specific optimization until a comparison requires it. Why Mova: bounded analytical work could avoid unnecessary computation while retaining a clear account of which candidates were actually examined. The benefit would need measurement.

Idea: Publish reproducible analytical artifacts. Where: the supporting code descriptions and “The Utility and Future of powerlaw.” Area: eval/reproducibility. Mova: вже є (reproduction commands, retained traces, source fingerprints, and experiment journals). Applying the same practice to distribution analysis would preserve observations, settings, and the exact outputs used in a claim. Why Mova: an inspectable receipt helps reviewers distinguish a repeatable calculation from a broad conclusion that the calculation does not establish.

### The problem and its context

#### Why an uneven distribution demands care

A power law describes a particular relationship between the size of an observation and its probability. As values grow, their probabilities decline according to an exponent. The decline can leave substantial probability in the far-right tail, where the largest observations occur. The authors introduce this as a reason power laws attract theoretical interest: under the conditions they state, familiar measures such as the mean or standard deviation may cease to be defined.

This differs from merely saying that a dataset contains some large values. The relevant question concerns the overall probability pattern and how it changes across the range. An isolated extreme observation does not identify a distribution. Nor does a broad spread guarantee a power law. The paper’s practical concern is that researchers can move too quickly from an uneven dataset to a strong distributional claim.

The scientific attraction is understandable. A description without a characteristic size suggests behavior that remains related across scales. The paper points to applications in astrophysics, linguistics, and neuroscience, showing that the problem is not confined to one measurement technology or subject area. Yet the same breadth creates a methodological difficulty: data collected in different domains come with different units, boundaries, sampling conditions, and possible generating processes.

For language, the motivating example is the uneven use of words. Some words recur very frequently, while many occur less often. The Moby Dick data provide a familiar case for investigating that distribution. The authors nevertheless use it to demonstrate uncertainty between candidate descriptions, making clear that familiarity is not a substitute for comparison.

The neuronal example poses a different scientific question. The number of connections associated with each C. elegans neuron may reflect a growth process, but the organism has a limited number of neurons. A candidate explanation therefore has to accommodate both unequal accumulation and finite capacity. The blackout example supplies another contrast: a broad tail can look suggestive even when a comparison against an exponential alternative does not provide persuasive evidence for the power law.

#### What earlier methods supplied

The authors build on statistical procedures developed in earlier work, particularly the analyses by Clauset, Shalizi, and Newman and by Klaus, Yu, and Plenz. They credit those contributions with methods for fitting power laws and assessing the resulting descriptions. Their package is presented primarily as a way to make those procedures accessible and consistently usable, rather than as a replacement statistical theory.

The obstacle was practical as well as conceptual. Correct analysis requires several connected operations: choosing a range, estimating parameters, measuring discrepancy, and comparing candidates. A researcher also needs to handle variations such as integer observations or an upper boundary. Having individual routines available does not necessarily make the complete analysis easy to perform.

Earlier freely available software existed, including the implementations acknowledged by the authors and the package plfit. The paper’s criticism concerns integration, coverage, and maintainability. According to the authors, completing an analysis with those alternatives could require more elaborate user-written code, and the available combinations of distribution families and settings were narrower.

Powerlaw addresses that gap by arranging related operations around shared objects. The user can examine a dataset, obtain different candidate fits, visualize them, and request a comparison without rebuilding the analytical context at each step. The authors also emphasize an architecture that contributors can extend. The intended gain is a lower barrier to appropriate analysis, alongside enough flexibility to address differences between scientific datasets.

#### Why the question should remain comparative

The paper distinguishes asking whether a dataset could have arisen from a power law from asking whether a power law is the strongest available description. These questions overlap, but they are not interchangeable.

An individual goodness-of-fit assessment can examine whether discrepancies from a fitted distribution are compatible with sampling variation. The paper describes a bootstrap-based approach using the Kolmogorov–Smirnov statistic for that purpose. Passing such an assessment does not make competing descriptions disappear. A lognormal distribution could still account for the same observations at least as convincingly.

Conversely, the authors argue that sufficiently detailed empirical data may depart from an ideal mathematical distribution because real processes include noise and imperfections. Under that view, rejecting perfect agreement does not necessarily eliminate the practical value of a distributional description. Their preference for comparison follows from this distinction: the useful question often concerns which scientifically meaningful account performs better.

This position still leaves an important responsibility with the researcher. A comparison can only distinguish the candidates actually considered, and adding flexibility can improve fit without improving explanation. The paper therefore joins statistical comparison to scientific hypotheses about the processes that produced the observations.

### The method, step by step

#### Begin with the meaning of the measurements

Before estimating anything, the researcher must decide what an observation represents. Is it a count, such as the number of connections attached to a neuron, or a measurement treated as continuous? Could values exceed the largest recorded observation, or did the collection process impose a genuine ceiling? Are observations plausibly independent?

These questions determine which calculations are appropriate. They are not details that a plotting function can settle. Powerlaw exposes corresponding options, but the source of their justification is the scientific setting.

The package’s main organizational unit, Fit, retains a dataset and provides access to fitted distributions. A Distribution object represents a particular candidate and its fitted parameters. The authors describe the candidate-specific calculations as being performed when requested. This arrangement makes it possible to share an analytical context while comparing alternatives.

From observations to a defensible distribution comparison The steps in order.

The flow includes both automated calculations and decisions that remain external to the software. In particular, the final step is a scientific recommendation: the package can report that alternatives are unresolved, but it cannot replace an experiment that distinguishes their causes.

#### Understand the power-law expression

The paper begins from the following relationship:

```
p(x) ∝ x^(−α)
```

Here x is a possible observed value, p(x) describes its probability density or probability mass in the relevant setting, and α is the exponent controlling the decline. The proportionality symbol means that the expression still requires the appropriate normalization over the distribution’s allowed range.

The lower boundary matters to that normalization and to the scientific claim. A power-law description need not cover all observations. The paper denotes the beginning of the fitted range by x_min and an optional upper boundary by x_max.

The authors connect the exponent to the existence of familiar summary statistics. They state that the standard deviation can be undefined for α \< 3 and that the mean can be undefined for α \< 2. These statements describe the theoretical distribution under discussion. They do not mean that the finite observations supplied to a program lack an arithmetic average.

That distinction helps explain why extreme values deserve attention. A finite dataset may produce an ordinary-looking summary, while the proposed distribution says that very large outcomes remain sufficiently important to undermine the usual characteristic-scale interpretation.

#### Choose a display suited to the question

The package supports density, cumulative, and complementary cumulative representations. The cumulative expression used in the paper is:

```
CDF(x) = p(X < x)
```

X denotes the random quantity being measured, x is a chosen threshold, and CDF(x) is the probability that an observation falls below that threshold. The notation expresses an accumulated probability rather than the probability attached to a narrow interval around x.

The complementary version is:

```
CCDF(x) = p(X ≥ x)
```

CCDF(x) gives the probability of an observation at least as large as x. The authors also call this the survival function. It is frequently useful for a heavy tail because it directly describes how much probability remains beyond a threshold.

A density histogram requires bins. Equal-width bins can become unstable in a sparse tail: many contain very few observations, while some contain none. On logarithmic axes, powerlaw therefore defaults to bins whose widths increase with magnitude. Their probabilities are normalized to account for the changing widths.

This is a presentation decision, not an additional fitting result. Wider tail bins gather information over a broader range and make the display easier to read, but they do not create new observations. Cumulative displays avoid the binning choice, although they can make local peaks less apparent.

The paper also warns that cumulative and density views respond differently to an upper boundary. Near x_max, a bounded power law’s cumulative tail bends downward, whereas its density can retain a straight appearance on logarithmic axes until the boundary. A reader who expects every power-law display to be straight could otherwise mistake a collection limit for contradictory evidence.

#### Locate the lower boundary

When the user does not specify x_min, the package searches candidate starting values drawn from the distinct observations. At each starting value it fits a power law to the corresponding tail and computes the Kolmogorov–Smirnov distance, denoted D.

D measures the greatest separation between the empirical cumulative distribution and the fitted cumulative distribution. The selected lower boundary minimizes this discrepancy among the candidate ranges considered. The procedure therefore chooses both a parameter estimate and the subset to which that estimate applies.

A researcher can instead specify a lower boundary or restrict the search to an interval. The paper gives several possible reasons: a theoretical minimum, a noise threshold, or a decision to begin at the smallest observed value. These are different justifications and should remain distinguishable in an interpretation.

A small D should not be read as an unrestricted endorsement. It concerns agreement over the selected range, under the candidate distribution and fitting procedure. The observations below the boundary have not been explained by that fitted tail.

#### Declare an upper boundary when justified

An upper limit can arise because values beyond it are physically impossible or because the observations cover only part of a larger system. The authors use a recording window in neuroscience to illustrate the latter situation: an observation cannot exceed the size of the system portion being recorded, even when the larger system might support greater events.

Powerlaw does not infer this scientific distinction automatically. The user supplies x_max, and observations above it are excluded from fitting. Candidate distributions are then defined within the admitted range.

The authors suggest changing the observation window experimentally when finite-size effects are suspected. If the pattern persists appropriately under a new boundary, that provides information unavailable from a single bounded collection. The important point is that the largest observed value and a scientifically established ceiling are not automatically the same thing.

#### Estimate continuous or discrete parameters

Continuous observations are the default. Integer-valued data require the discrete option so that probabilities are normalized on the appropriate support. The authors emphasize that using a continuous form for discrete observations can produce inaccurate estimates.

For a continuous power law with a specified lower boundary, the maximum-likelihood estimate can be obtained analytically. For the discrete case, the corresponding calculation requires numerical optimization. Repeating that optimization across candidate lower boundaries can be costly.

The package therefore offers a faster analytic estimate for the discrete exponent. The paper attributes its accuracy condition to earlier work: without an upper boundary, the estimate is accurate to about 1% or better when x_min ≥ 6. This condition belongs to that particular parameter-estimation approximation. It should not be transferred automatically to other approximations in the package.

Some other distribution families also need a practical discrete representation. The authors describe evaluating a continuous form at integer values and normalizing over a chosen finite range, or assigning probability by rounding continuous values to their nearest integer.

For the rounding approach, the relevant interval is:

```
x − 0.5 ≤ continuous value ≤ x + 0.5
```

Here x is the integer whose probability mass is being approximated. The endpoints identify the continuous values assigned to that integer under rounding. The paper’s description makes clear that this method and finite-range normalization are different approximations, with potentially different fitted parameters.

#### Compare candidates and interpret the sign

After fitting, the package can compare candidates using a loglikelihood ratio. Likelihood measures how well a specified distribution accounts for the observed values. The ratio is positive when the observations favor the first candidate and negative when they favor the second.

The returned significance value p concerns the reliability of that directional preference. A positive ratio alone is therefore not sufficient grounds for announcing a winner. The examples repeatedly distinguish the direction of the estimate from the strength of the evidence.

The normalized ratio described in the paper is:

```
R_normalized = R / (σ√n)
```

R is the unnormalized loglikelihood ratio, σ is the standard-deviation quantity used in its normalization, and n is the number of observations entering the comparison. R_normalized is the normalized statistic used to calculate the significance value. This σ belongs to the comparison calculation; it should not be confused with either the standard error of the fitted exponent or a lognormal parameter that shares the same symbol.

The package also handles nested candidates, where one distribution is a special case of another. The significance calculation must account for that relationship. The authors describe automatic recognition based on candidate names and an explicit option for declaring nesting.

#### Add restrictions without hiding their effects

Powerlaw can restrict parameter ranges and the uncertainty allowed in selecting a lower boundary. The authors distinguish filtering candidate starting points according to an uncertainty threshold from restricting the parameter search within a candidate fit.

One illustrated requirement is:

```
σ / α < .05
```

Here σ is the standard error associated with the fitted exponent, and α is that exponent. Their ratio expresses uncertainty relative to the estimate. This criterion can reject a candidate range even when its distance D is attractive.

Because restrictions can change the selected range, the package preserves the lower boundaries considered and their associated distances, exponents, and errors. Inspecting these arrays reveals whether another plausible solution lies nearby or whether the final choice is sensitive to the imposed requirement.

A failed constraint does not necessarily halt the calculation. In the example where no boundary meets an uncertainty threshold, the package returns the best unconstrained boundary and sets noise_flag. The returned estimate must therefore be interpreted together with its status.

#### Use simulation and alternative objectives carefully

Distribution objects can generate synthetic observations. The authors use this ability to check whether fitting recovers known parameters. Simulation is especially informative for numerical validation because the generating distribution is specified in advance.

Discrete sampling introduces a separate speed–accuracy decision. The paper distinguishes a fast approximation from a slower exact-search procedure. Its error depends on the lower boundary, so an approximation that is suitable in one range may be undesirable in another.

The package can also fit using a minimum-distance objective instead of maximum likelihood. Separately, it can select x_min using Kolmogorov–Smirnov, Kuiper, or Anderson–Darling distance. These choices affect different parts of the analysis. Changing the fitting objective does not remove the independence assumption from a subsequent likelihood-ratio comparison.

### Experiments and results

#### Demonstrations across contrasting empirical datasets

The empirical examples are selected to illustrate different strengths of apparent power-law behavior. They are not a competition scored by a single benchmark metric. Word frequencies from Moby Dick supply the strongest visual example, C. elegans connection counts provide an intermediate case, and the numbers affected by United States electricity blackouts between 1984 and 2002 provide the weakest.

The paper uses these datasets to show visualization, range selection, and candidate comparison. It does not report a common sample size for the empirical demonstrations in the main text. Their role is explanatory: each exposes a different way an apparently straightforward fitting decision can become scientifically consequential.

Figure 1 contrasts equal-width and logarithmically spaced histogram bins. The blackout observations make the visual problem particularly clear because sparse bins create an unstable tail display. The same figure then contrasts a lower boundary fixed at 1 with an automatically selected boundary, before comparing the resulting power law with an exponential candidate.

These illustrations establish what the package calculates and why its options matter. They do not establish that every dataset with similar-looking plots has the same distribution.

#### How range selection changes the blackout fit

The automatic blackout fit selects x_min = 230.000. Its exponent is 2.273, the exponent’s reported standard error is 0.167, and D is 0.061. When the lower boundary is fixed at 1.0, the exponent becomes 1.220 and D becomes 0.376.

Blackout data, Kolmogorov–Smirnov distance by lower-bound setting Selecting the tail boundary gives closer agreement over its fitted range.

**The numbers**

| System or setting | Kolmogorov–Smirnov distance D |
| --- | --- |
| Fixed lower boundary, xmin=1.0 | 0.376 |
| Automatically selected lower boundary, xmin=230.000 (this paper) | 0.061 |

The comparison shows that the chosen range strongly affects the fitted description. It does not mean the automatic setting explains every observation more successfully: it evaluates a tail that excludes smaller values. The lower distance must be read with that scope.

Restricting the lower-bound search to the interval from 250.0 to 300.0 gives x_min = 272.0. This demonstrates another kind of control: a researcher can let the software search while limiting it to a scientifically admitted region. The paper does not present that restricted result as universally preferable.

The blackout comparison against an exponential returns an unnormalized likelihood ratio of 12.755 with p = 0.152. With normalization requested, the ratio is 1.431 and p remains 0.152. The direction favors the power law, but the authors do not treat this as persuasive evidence that the distribution is heavy-tailed.

That interpretation is one of the paper’s most useful examples. A researcher could otherwise report the positive ratio while overlooking that the comparison has not convincingly separated the candidates.

#### What the neuronal comparisons establish

For C. elegans connection counts, the power-law versus exponential comparison returns R = 16.384 and p = 0.024. Under the paper’s interpretation, this supports the power law relative to the exponential alternative.

The next comparison asks a different question. A finite organism has a limited set of possible neuronal connections, so a tail that eventually tapers is scientifically plausible. Comparing the power law against an exponentially truncated power law returns R = −0.081 and p = 0.687.

The negative direction favors the truncated candidate, but the significance result does not establish it as stronger. The authors characterize the evidence for an unrestricted power law as moderate because exponential truncation remains unresolved.

The sequence matters. Evidence against an exponential does not settle the comparison against a truncated power law. Each comparison removes, or fails to remove, a different uncertainty. Treating the first favorable result as the end of the analysis would overstate what the observations establish.

#### Why familiar word frequencies remain ambiguous

For the Moby Dick word-frequency data, the power-law versus lognormal comparison yields R = 0.928 and p = 0.426. The authors use this result to illustrate the difficulty of separating heavy-tailed candidates from finite observations.

The plotted cumulative curves both track the empirical pattern closely enough that appearance alone does not provide a decisive distinction. The likelihood-ratio comparison also leaves the issue unresolved.

The paper connects that ambiguity to possible generating processes. A preferential-attachment account motivates a power law, whereas multiplicative accumulation motivates considering a lognormal description. These are reasons to investigate candidates, not demonstrations that either process generated the specific word-frequency observations.

The authors’ recommended next step is therefore scientific rather than cosmetic: seek an experiment that distinguishes the processes. Merely finding another visually convincing curve would not resolve the causal question.

#### Numerical behavior of discrete calculations

The discrete blackout example compares the default analytic estimate with numerical optimization. With estimation enabled, the fitted exponent is 2.26912. With estimation disabled, it is 2.26914.

The close values illustrate the approximation in that setting. They are not a general error bound for every dataset, every lower boundary, or an analysis with an upper cutoff. The broader accuracy condition belongs to the earlier-method result discussed in the method section.

For discrete lognormal calculations, the paper reports substantially different μ values under different approximations and ranges. Using normalization up to x_max = 9000 gives μ = −44.19; using a finite approximation limit of 100,000 gives μ = 0.28; rounding gives μ = 0.40. The examples also differ in their upper-range settings, so they do not isolate approximation technique alone.

Their practical message is that discretization and normalization are consequential analytical choices. A shared family name does not guarantee that two computations used equivalent probability assignments.

#### Recovery from synthetic data

The simulation example specifies x_min = 5.0 and α = 2.5, generates 10,000 observations, and then fits them. The reported recovery is x_min = 5.30 and α = 2.50.

Figure S1 broadens this validation across continuous and discrete cases and across different generating parameters. Each fitted result averages 10 simulated datasets containing 10,000 observations apiece. The shading represents variation across those simulations.

The authors explain an important feature of the lower-bound recovery. These synthetic datasets contain nothing below the true x_min. Consequently, fluctuations in the estimated boundary cannot place it below that true boundary. The figure’s pattern must be interpreted in light of this restriction rather than as an unrestricted test of boundary recovery.

For approximate discrete random generation, the paper reports error above 8% at x_min = 1, below 1% at x_min = 5, and below .2% at x_min = 10. These figures concern the sampling approximation, not the separate approximation used to estimate an exponent.

### What the ablations show

The paper has no conventional ablation study that removes package components from a shared predictive system; instead, it offers controlled setting comparisons, numerical demonstrations, and simulation checks.

#### The analysis range changes the question

The blackout lower-bound comparison is the clearest demonstration of sensitivity. Fitting from a fixed low boundary and selecting a tail boundary produce different exponents and different distances.

The result shows why preprocessing cannot be treated as independent of interpretation. Excluding smaller observations changes the empirical claim. It can reveal a coherent tail, but the researcher must not quietly extend that coherence to observations excluded from the calculation.

The alternative lower-bound minima deepen this point. The authors identify a local minimum at x_min = 50 with D = .1 and α = 1.78. The stronger minimum occurs at x_min = 230 with D = .06 and α = 2.27.

The second candidate wins under distance minimization, but its uncertainty is less favorable. A requirement on uncertainty can therefore redirect selection toward a different range. This is not an inconsistency in the software: it reflects a changed optimization problem.

#### Constraints reveal tradeoffs and fallback behavior

With sigma_threshold = .1, the blackout fit returns α = 1.78, σ = 0.06, and x_min = 50.00. A more elaborate range restriction returns α = 2.30, σ = 0.17, and x_min = 234.00. The relative-error constraint gives α = 1.88, σ = 0.09, and x_min = 124.00.

These settings illustrate different ways of defining an admissible fit. They should not be ranked as though each were optimizing the same requirement. Some favor lower uncertainty; another restricts the exponent; another constrains a ratio.

The most stringent illustrated uncertainty requirement, sigma_threshold = .001, finds no valid fit. The package then returns α = 2.27, σ = 0.17, and x_min = 230.00 with noise_flag set to True. This example reveals an interface behavior that matters for automation: a returned number may accompany an explicitly unsuccessful requirement.

The constrained lognormal demonstration exposes a separate issue. With μ restricted to begin at 11.0, the initial attempt returns μ = 6.22 and σ = 0.72 with a failure flag. Supplying a different starting point produces μ = 11.00 and σ = 5.72 without that flag.

The comparison indicates that numerical search can fail because its initial position is unsuitable for an unusual feasible region. It does not establish that the constrained distribution itself is impossible.

#### Approximation checks have distinct scopes

The discrete exponent comparison shows close agreement between the fast estimate and numerical optimization for the illustrated blackout analysis. The sampling-error discussion shows that generating random observations has its own dependence on x_min.

Together, these analyses argue against treating “approximate” as a single undifferentiated category. Each accelerated operation needs its own accuracy statement. A parameter estimator and a random generator perform different tasks even when their options have similar names.

The alternative discrete lognormal settings are more exploratory than isolating. Since the range and normalization choices vary together, the displayed parameter changes cannot be attributed exclusively to one algorithmic component. A careful reader should preserve that qualification rather than describe the example as a clean ablation.

#### Alternative distance metrics receive guidance, not a new benchmark

The authors discuss Kolmogorov–Smirnov, Kuiper, and Anderson–Darling distances, but do not provide a new numerical comparison across the empirical datasets for all those choices.

Their account draws on earlier analyses: Kuiper distance does not yield a notable advantage, while Anderson–Darling can be sufficiently sensitive to select too little data for a reliable fit. The possible exception is a sufficiently large dataset with abundant tail observations.

This discussion broadens the analyst’s options while resisting the assumption that a more tail-sensitive measure must be better. Sensitivity is useful only when enough observations remain to support the resulting estimate.

### Limitations

#### Limits the authors explicitly identify

Independence is a foundational assumption for the maximum-likelihood fitting and likelihood-ratio comparisons discussed in the paper. If observations are correlated, the apparent amount of evidence can be misleading and the fitted result can change.

The authors illustrate this with geographically related peaks: a large mountain and nearby foothills may not constitute unrelated observations. They discuss removing observations within a known correlation range as a possible remedy when the domain supports it. The package does not automatically discover that structure.

They also describe minimum-distance fitting as an alternative estimation approach, while explicitly warning that it does not solve dependence in the subsequent likelihood-ratio comparison. This restriction is easy to miss because changing one method can create an impression that the entire pipeline has been repaired.

The interpretation of upper bounds is another acknowledged limit. A physical ceiling and a finite recording window require scientific knowledge. The software can honor a supplied boundary, but it cannot determine why that boundary exists or whether it represents the larger system.

Candidate ambiguity is also explicit. Power laws can be difficult to distinguish from lognormal or stretched-exponential descriptions. An unresolved comparison supports uncertainty among the tested candidates, not a claim that one must be correct.

The authors further warn about overfitting. Adding distributions and parameters can improve agreement with the observed values without producing a stronger scientific explanation. They propose domain-specific generating processes as a guide for choosing candidates, instead of recommending an unrestricted search for the closest curve.

Approximation introduces conditional accuracy. The discrete exponent estimate has a stated applicability condition, and approximate discrete sampling becomes less accurate at small lower boundaries. A default chosen for speed therefore cannot be assumed appropriate for every use.

Numerical search can fail under extreme restrictions, and the package may return an initial estimate or an unconstrained fit with a warning flag. Users must inspect that status. This is especially consequential when software is embedded in a larger automatic workflow.

Finally, the paper identifies a numerical dependency issue involving gamma-function calculations for negative arguments. Its use of mpmath is motivated by the needs of particular distributions. This illustrates that a high-level statistical interface still depends on the reliability of its numerical foundations.

#### Limits visible in the demonstrations

The empirical examples are instructive, but they are not a comprehensive assessment of every supported distribution and setting. The package’s breadth is described through its design and available options, while quantitative demonstrations concentrate on selected cases.

The main text does not provide a uniform empirical dataset inventory with sample sizes, collection details, and every preprocessing choice. This limits how far the reported examples can be compared against one another. They are best read as demonstrations of analytical reasoning rather than a common leaderboard.

The software comparison is also primarily descriptive. The authors explain differences in integration, supported variants, and extensibility, but do not report a systematic timing benchmark against all earlier packages. Statements about reduced programming effort express an interface advantage without a controlled user study.

The range-selection results need careful interpretation because competing settings can analyze different subsets. A lower distance after excluding observations is evidence about the retained range. It is not automatically evidence that the candidate accounts better for the complete dataset.

Likewise, the discrete lognormal examples do not hold every setting constant. Their parameter differences show sensitivity to analytical choices, but cannot isolate the contribution of discretization from the contribution of the admitted range.

The synthetic validation answers a narrower question than the empirical analysis. Recovering known parameters from generated observations checks implementation behavior under a specified distribution. It does not demonstrate that actual neuronal, linguistic, or blackout observations were produced by that distribution.

Figure S1’s lack of observations below the true boundary creates an additional restriction. It is useful for checking recovery on a clean tail, but it does not independently demonstrate performance under every kind of contamination beneath the scaling region.

#### What a successful comparison still cannot establish

A likelihood-ratio result concerns the candidates, observations, and range entering that calculation. It cannot rule out an untested alternative or establish a unique generating process.

This distinction is particularly important for the preferential-attachment discussion. The fact that such a process motivates a power-law candidate does not mean that a favorable distributional comparison verifies the process. Different processes can motivate similar observable shapes, and finite data may leave their implications difficult to separate.

Nor does a strong fit identify how the system will behave beyond the observed range. An apparent tail may be affected by a physical bound, a changing process, or a collection limit. The paper’s recommendation to vary observation windows and investigate mechanisms recognizes that fitting alone cannot settle those questions.

The authors’ emphasis on comparative testing is therefore best understood as a disciplined improvement over unexamined visual claims. It provides evidence between stated alternatives while retaining the need for domain knowledge, adequate data, and explicit assumptions.

### What came after

A documented account of later uptake is unavailable, so no subsequent application, benchmark, or extension can be attributed to powerlaw on that basis. The paper itself supports a discussion of intended development, rather than verified claims about what later researchers accomplished.

The authors anticipate adding more candidate distributions through subclasses of the common Distribution interface. This would let an extension reuse the surrounding machinery for fitting, plotting, and comparison. They also describe contributions already received from users as evidence that the architecture can accommodate improvements without reorganizing the entire package.

Another proposed direction concerns numerical computation. Faster or more accurate procedures for distributions not yet handled efficiently could be incorporated as they become available. The dependency discussion similarly identifies a condition under which some gamma-function calculations might no longer require a separate numerical package. These are conditional development possibilities, not reported later outcomes.

The lasting research agenda stated by the authors is broader than adding software features. Better interfaces should make careful statistical work easier, while unresolved comparisons should motivate better scientific experiments. The package’s purpose is to help researchers reach a defensible boundary between what the observations favor, what they leave ambiguous, and what must be investigated by another kind of evidence.

## Cite

Cite as Jeff Alstott, Edward Thomas Bullmore and Dietmar Plenz. 2014. powerlaw: A Python Package for Analysis of Heavy-Tailed Distributions. PLoS ONE.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1371/journal.pone.0085777](https://doi.org/10.1371/journal.pone.0085777) · [arXiv 1305.0215](https://arxiv.org/abs/1305.0215)

```bibtex
@inproceedings{alstott2014powerlaw,
  title = {{powerlaw: A Python Package for Analysis of Heavy-Tailed Distributions}},
  author = {Jeff Alstott, Edward Thomas Bullmore and Dietmar Plenz},
  booktitle = {PLoS ONE},
  year = {2014},
  doi = {10.1371/journal.pone.0085777},
  eprint = {1305.0215},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1371/journal.pone.0085777}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
