The metalog distribution is a flexible continuous probability distribution designed for ease of use in practice. Together with its transforms, the metalog family of continuous distributions is unique because it embodies all of following properties: virtually unlimited shape flexibility; a choice among unbounded, semi-bounded, and bounded distributions; ease of fitting to data with linear least squares; simple, closed-form quantile function (inverse CDF) equations that facilitate simulation; a simple, closed-form PDF; and Bayesian updating in closed form in light of new data. Moreover, like a Taylor series, metalog distributions may have any number of terms, depending on the degree of shape flexibility desired and other application needs.
Applications where metalog distributions can be useful typically involve fitting empirical data, simulated data, or expert-elicited quantiles to smooth, continuous probability distributions. Fields of application are wide-ranging, and include economics, science, engineering, and numerous other fields. The metalog distributions, also known as the Keelin distributions, were first published in 2016 by Tom Keelin.
The history of probability distributions can be viewed, in part, as a progression of developments towards greater flexibility in shape and bounds when fitting to data. The normal distribution was first published in 1756, and Bayes’ theorem in 1763. The normal distribution laid the foundation for much of the development of classical statistics. In contrast, Bayes' theorem laid the foundation for the state-of-information, belief-based probability representations. Because belief-based probabilities can take on any shape and may have natural bounds, probability distributions flexible enough to accommodate both were needed. Moreover, many empirical and experimental data sets exhibited shapes that could not be well matched by the normal or other continuous distributions. So began the search for continuous probability distributions with flexible shapes and bounds.
Early in the 20th century, the Pearson family of distributions, which includes the normal, beta, uniform, gamma, student-t, chi-square, F, and five others, emerged as a major advance in shape flexibility. These were followed by the Johnson distributions. Both families can represent the first four moments of data (mean, variance, skewness, and kurtosis) with smooth continuous curves. However, they have no ability to match fifth or higher-order moments. Moreover, for a given skewness and kurtosis, there is no choice of bounds. For example, matching the first four moments of a data set may yield a distribution with a negative lower bound, even though it might be known that the quantity in question cannot be negative. Finally, their equations include intractable integrals and complex statistical functions, so that fitting to data typically requires iterative methods.
Early in the 21st century, decision analysts began working to develop continuous probability distributions that would exactly fit any specified three points on the cumulative distribution function for an uncertain quantity (e.g., expert-elicited , and quantiles). The Pearson and the Johnson family distributions were generally inadequate for this purpose. In addition, decision analysts also sought probability distributions that would be easy to parameterize with data (e.g., by using linear least squares, or equivalently, multiple linear regression). Introduced in 2011, the class of quantile-parameterized distributions (QPDs) accomplished both goals. While being a significant advance for this reason, the QPD originally used to illustrate this class of distributions, the Simple Q-Normal distribution, had less shape flexibility than the Pearson and Johnson families, and lacked the ability to represent semi-bounded and bounded distributions. Shortly thereafter, Keelin developed the family of metalog distributions, another instance of the QPD class, which is more shape-flexible than the Pearson and Johnson families, offers a choice of boundedness, has closed-form equations that can be fit to data with linear least squares, and has closed-form quantile functions, which facilitate Monte Carlo simulation.
The metalog distribution is a generalization of the logistic distribution, where the term "metalog" is short for "metalogistic". Starting with the logistic quantile function, , Keelin substituted power series expansions in cumulative probability for the and the parameters, which control location and scale, respectively.
Keelin's rationale for this substitution was fivefold. First, the resulting quantile function would have significant shape flexibility, governed by the coefficients . Second, it would have a simple closed form that is linear in these coefficients, implying that they could easily be determined from CDF data by linear least squares. Third, the resulting quantile function would be smooth, differentiable, and analytic, ensuring that a smooth, closed-form PDF would be available. Fourth, simulation would be facilitated by the resulting closed-form inverse CDF. Fifth, like a Taylor series, any number of terms could be used, depending on the degree of shape flexibility desired and other application needs.
Note that the subscripts of the -coefficients are such that and are in the expansion, and are in the expansion, and subscripts alternate thereafter. This ordering was chosen so that the first two terms in the resulting metalog quantile function correspond to the logistic distribution exactly; adding a third term with adjusts skewness; adding a fourth term with adjusts kurtosis primarily; and adding subsequent non-zero terms yields more nuanced shape refinements.: p.252
Rewriting the logistic quantile function to incorporate the above substitutions for and yields the metalog quantile function, for cumulative probability .
Equivalently, the metalog quantile function can be expressed in terms of basis functions: , where the metalog basis functions are and each subsequent is defined as the expression that is multiplied by in the equation for above. Note that coefficient is the median, since all other terms equal zero when . Special cases of the metalog quantile function are the logistic distribution () and the uniform distribution ( otherwise).
Differentiating with respect to yields the quantile density function . The reciprocal of this quantity, , is the probability density function expressed as a p-PDF,
which may be equivalently expressed in terms of basis functions as
Note that this PDF is expressed as a function of cumulative probability, , rather than variable of interest, . To plot the PDF (e.g., as shown in the figures on this page), one can vary parametrically, and then plot on the horizontal axis and on the vertical axis.
Based on the above equations and the following transformations that enable a choice of bounds, the family of metalog distributions is composed of unbounded, semibounded, and bounded metalogs, along with their symmetric-percentile triplet (SPT) special cases.
As defined above, the metalog distribution is unbounded, except in the unusual special case where for all terms that contain . However, many applications require flexible probability distributions that have a lower bound , an upper bound , or both. To meet this need, Keelin used transformations to derive semi-bounded and bounded metalog distributions. Such transformations are governed by a general property of quantile functions: for any quantile function and increasing function is also a quantile function. For example, the quantile function of the normal distribution is ; since the natural logarithm, , is an increasing function, is the quantile function of the lognormal distribution. Analogously, applying this property to the metalog quantile function using the transformations below yields the semi-bounded and bounded members of the metalog family. By considering to be metalog-distributed, all members of the metalog family meet Keelin and Powley's definition of a quantile-parameterized distribution and thus possess the properties thereof.
Note that the number of shape parameters in the metalog family increases linearly with the number of terms . Therefore, any of the above metalogs may have any number of shape parameters. By contrast, the Pearson and Johnson families of distributions are limited to two shape parameters.
The symmetric-percentile triplet (SPT) metalog distributions are a three-term special case of the unbounded, semi-bounded, and bounded metalog distributions. These are parameterized by the three points off the CDF curve, of the form , , and , where . SPT metalogs are useful when, for example, quantiles corresponding to the CDF probabilities (e.g. ) are elicited from an expert and used to parameterize the three-term metalog distributions. As noted below, certain mathematical properties are simplified by the SPT parameterization.
The metalog family of probability distributions has the following properties.
A function of the form of or any of its above transforms is a feasible probability distribution if and only if its PDF is greater than zero for all  This implies a feasibility constraint on the set of coefficients ,
In practical applications, feasibility must generally be checked rather than assumed. For , ensures feasibility. For (including SPT metalogs), the feasibility condition is and . For , a similar closed form has been derived. For , feasibility is typically checked graphically or numerically.
The unbounded metalog and its above transforms share the same set of feasible coefficients. Therefore, for a given set of coefficients, confirming that for all is sufficient regardless of the transform in use.
The set of feasible metalog coefficients for all is convex. Because convex optimization problems require convex feasible sets, this property can simplify optimization problems involving metalogs. Moreover, this property guarantees that any convex combination of the vectors of feasible metalogs is feasible, which is useful, for example, when combining the opinion of multiple experts or interpolating among feasible metalogs. By implication, any probabilistic mixture of metalog distributions is itself a metalog.
The coefficients can be determined from data by linear least squares. Given data points that are intended to characterize a metalog CDF, and an matrix whose elements consist of the basis functions , then as long as is invertible, the column vector of the coefficients is given by , where and column vector . If , this equation reduces to , where the resulting metalog CDF runs through all data points exactly. For SPT metalogs, it further reduces to expressions in terms of the three points directly.
An alternate fitting method, implemented as a linear program, determines the coefficients by minimizing the sum of absolute distances between the CDF and the data, subject to feasibility constraints.
According to the metalog flexibility theorem, any probability distribution with a continuous quantile function can be approximated arbitrarily closely by a metalog. Moreover, in the original paper, Keelin showed that ten-term metalog distributions parameterized by 105 CDF points from 30 traditional source distributions (including the normal, student-t, lognormal, gamma, beta, and extreme-value distributions) approximate each such source distribution within a K-S distance of 0.001 or less. Thus, metalog shape flexibility is virtually unlimited.
The animated figure on the right illustrates this for the standard normal distribution, where metalogs with various numbers of terms are parameterized by the same set of 105 points from the standard normal CDF. The metalog PDF converges to the standard normal PDF as the number of terms increases. With two terms, the metalog approximates the normal with a logistic distribution. With each increment in number of terms, the fit gets closer. With 10 terms, the metalog PDF and standard normal PDF are visually indistinguishable.
Similarly, nine-term semi-bounded metalog PDFs with are visually indistinguishable from a range of Weibull distributions. The six cases shown to the right correspond to Weibull shape parameters 0.5, 0.8, 1.0, 1.5, 2, and 4. In each case, the metalog is parameterized by the nine points from the Weibull CDF that correspond to the cumulative probabilities .
Such convergence is not unique to the normal and Weibull distributions. Keelin originally showed analogous results for a wide range of distributions and has since provided further illustrations.
The median of any distribution in the metalog family has a simple closed form. Note that defines the median, and (since all subsequent terms are zero for ). It follows that the medians of the unbounded metalog, log metalog, negative-log metalog, and logit metalog distributions are , , , and , respectively.
The moment of the unbounded metalog distribution, , is a special case of the more general formula for QPDs. For the unbounded metalog, such integrals evaluate to closed-form moments that are order polynomials in the coefficients . The first four central moments of the four-term unbounded metalog are:
Moments for fewer terms are subsumed in these equations. For example, moments of the three-term metalog can be obtained by setting to zero. Moments for metalogs with more terms, and higher-order moments (), are also available. Moments for semi-bounded and bounded metalogs are not available in closed form.
Three-term unbounded metalogs can be parameterized in closed form with their first three central moments. Let and be the mean, variance, and skewness, and let be the standardized skewness, . Equivalent expressions of the moments in terms of coefficients, and coefficients in terms of moments, are as follows:
The equivalence of these two sets of expressions can be derived by noting that the moments equations on the left determine a cubic polynomial in terms of the coefficients and , which can be solved in closed form as functions of and . Moreover, this solution is unique. In terms of moments, the feasibility condition is , which can be shown to be equivalent to the following feasibility condition in terms of the coefficients: ; and .
This property can be used, for example, to represent the sum of independent, non-identically distributed random variables. Based on cumulants, it is known that for any set of independent random variables, the mean, variance, and skewness of the sum are the sums of the respective means, variances, and skewnesses. Parameterizing a three-term metalog with these central moments yields a continuous distribution that exactly preserves these three moments, and accordingly provides a reasonable approximation to the shape of the distribution of the sum of independent random variables.
Since their quantile functions are expressed in closed form, metalogs facilitate Monte Carlo simulation. Substituting uniformly distributed random samples of into the Metalog quantile function (inverse CDF) produces random samples of in closed form, thereby eliminating the need to invert a CDF. See below for simulation applications.
Due to their shape flexibility, metalog distributions can be an attractive choice for eliciting and representing expert opinion. Moreover, if the opinions of multiple experts are expressed as -term metalogs, the consensus opinion may be calculated as a -term metalog in closed form, where the -coefficients of the consensus metalog are simply a weighted average of those of the individual experts. This result follows from Vincentization, where the consensus quantile function is a weighted average of individual quantile functions.
In a classic paper, Howard (1970) shows how the beta-binomial distribution can be used to update, according to Bayes rule in closed form, uncertainty over the long-run frequency of a coin toss coming up "heads" in light of new coin-toss data. In contrast, if the uncertainty of interest to be updated is defined not by a scalar probability over a discrete event (like the result of a coin toss) but by a probability density function over a continuous variable, metalog Bayesian updating may be used. Under certain conditions, metalog quantile parameters and -coefficients may be updated in closed form in light of new data according to Bayes rule.
Due to their shape and bounds flexibility, metalogs can be used to represent empirical or other data in virtually any field of human endeavor.
For a given application and data set, choosing the number of metalog terms requires judgment. For expert elicitation, three to five terms is usually sufficient. For data exploration and matching other probability distributions such as the sum of lognormals, eight to 12 terms is usually sufficient. A metalog panel, which displays the metalog PDFs corresponding to differing numbers of terms for a given data set, may aid this judgment. For example, in the steelhead weight metalog panel, using less than seven terms arguably underfits the data by obscuring the data's inherent bimodality. Using more than 10 terms is unnecessary and could, in principle, overfit the data. The case with 16 terms is infeasible for this data set, as indicated by the blank cell in the metalog panel. Keelin (2016) offers further perspectives on the distribution selection within the metalog family. Other tools (such as regularization, Akaike information criterion, and Bayesian information criterion) may also be useful.
The metalog distributions belong to the group of distributions defined in terms of the quantile function, which include the quantile-parameterized distributions, the Tukey lambda distribution, its generalization, GLD, the Govindarajulu distribution and others. The following distributions are subsumed within the metalog family:
Freely available software tools can be used to work with metalog distributions:
Commercially available packages also support the use of metalog distributions: