# The Metalog Distributions

 Metalog Flexibility Theorem
 Theorem: Any probability distribution with a continuous quantile function can be approximated arbitrarily closely by a metalog quantile function.
 Proof: Let ${displaystyle delta >0}$ be an arbitrarily small positive number and let ${displaystyle Q(y)}$ be a continuous quantile function defined on the probability interval ${displaystyle y}$ ∈ ${displaystyle (0,1)}$ . By the Weierstrass approximation theorem, for every ${displaystyle epsilon >0}$ there exists a polynomial ${displaystyle P(y)}$ such that ${displaystyle |Q(y)-P(y)| for all ${displaystyle y}$ ∈ ${displaystyle [delta ,1-delta ]}$ .  By setting the ${displaystyle a_{i}}$ to zero for all terms that include the factor ${displaystyle ln{Bigl (}{y over {1-y}}{Bigr )}}$ , the metalog quantile function ${displaystyle M(y)}$ reduces to a polynomial.  Therefore, there exists a metalog distribution ${displaystyle M(y)}$ such that ${displaystyle |Q(y)-M(y)| for all ${displaystyle y}$ ∈ ${displaystyle [delta ,1-delta ]}$ .
 While this theorem guarantees the existence of a such a metalog for any continuous quantile function, it does not guarantee its feasibility. It does guarantee, however, that there exists a metalog that is everywhere within $\epsilon$ of being feasible for any arbitrarily small positive number $\epsilon$ , which should be sufficient for most practical applications.
 Nor does this theorem provide a procedure for how to find the metalog ${displaystyle a_{i}}$ coefficients that correspond to an arbitrary continuous quantile function. Nor does it guarantee rapid convergence as the number of terms increases. But in practice, metalogs do converge rapidly and the coefficients can easily be determined by least squares. For example, we showed in the original paper, Table 8, that 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 as the number of metalog terms approaches ten.
 More broadly, this theorem equally applies to any quantile-parameterized distribution containing a polynomial with an unlimited number of terms.