GO-V.ORG
As seen in

Boltzmann sampler

A Boltzmann sampler is an algorithm intended for random sampling of combinatorial structures. If the object size is viewed as its energy, and the argument of the corresponding generating function is interpreted in terms of the temperature of the physical system, then a Boltzmann sampler returns an object from a classical Boltzmann distribution. The concept of Boltzmann sampler was proposed by Philippe Duchon, Philippe Flajolet, Guy Louchard and Gilles Schaeffer in 2004. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

A Boltzmann sampler is an algorithm intended for random sampling of combinatorial structures. If the object size is viewed as its energy, and the argument of the corresponding generating function is interpreted in terms of the temperature of the physical system, then a Boltzmann sampler returns an object from a classical Boltzmann distribution. The concept of Boltzmann sampler was proposed by Philippe Duchon, Philippe Flajolet, Guy Louchard and Gilles Schaeffer in 2004. C(z) = \sum_{c \in \mathcal C} z^{\omega(c)} = \sum_{n = 0}^\infty a_n z^n, where a_n denotes the number of objects c \in \mathcal C of size n . The size function is typically used to denote the number of vertices in a tree or in a graph, the number of letters in a word, etc. A Boltzmann sampler for the class \mathcal C with a parameter z such that 0 , denoted as \Gamma \mathcal C(z) returns an object c \in \mathcal C with probability \mathbb P(\Gamma \mathcal C(z) = c) = \dfrac{z^{\omega(c)}}{C(z)}. If \mathcal{C} = \{ c_1, \ldots, c_r \} is finite, then an element c_j is drawn with probability proportional to z^{\omega(c_j)} . If the target class is a disjoint union of two other classes, \mathcal C = \mathcal A + \mathcal B , and the generating functions A(z) and B(z) of \mathcal A and \mathcal B are known, then the Boltzmann sampler for \mathcal{C} can be obtained as \left( \operatorname{Bern} \left( \frac{A(z)}{C(z)} \right) \longrightarrow \Gamma \mathcal A(z) \mid \Gamma \mathcal B(z) \right) where (X \longrightarrow f \mid g) stands for "if the random variable X is 1, then execute f , else execute g ". More generally, if the disjoint union is taken over a finite set, the resulting Boltzmann sampler can be represented using a random choice with probabilities proportional to the values of the generating functions. If \mathcal C = \mathcal A \times \mathcal B is a class constructed of ordered pairs (a, b) where a \in \mathcal A and b \in \mathcal B , then the corresponding Boltzmann sampler \Gamma \mathcal C(z) can be obtained as \Gamma \mathcal C(z) = (\Gamma \mathcal A(z), \Gamma \mathcal B(z)), i.e. by forming a pair (a, b) with a and b drawn independently from \Gamma \mathcal A(z) and \Gamma \mathcal B(z) . C(z) = \sum_{k=0}^\infty A(z)^k = \dfrac{1}{1 - A(z)} , where A(z) is the generating function of \mathcal A . Alternatively, the class \mathcal C admits a recursive representation \mathcal C = 1 + \mathcal A \times \mathcal C. This gives two possibilities for \Gamma \mathcal C(z) . \Gamma \mathcal C(z) = \Gamma (1 + \mathcal A \times \mathcal C)(z) where (X \Longrightarrow f) stands for "draw a random variable X ; if the value X = x is returned, then execute f independently x times and return the sequence obtained". Here, \operatorname{Geom}(p) stands for the geometric distribution \mathbb P(\operatorname{Geom}(p) = k) = p^k (1 - p) . \mathcal C_1 = \Phi_1(\mathcal C_1, \ldots, \mathcal C_n, \mathcal Z),\\ \qquad \vdots \\ \mathcal C_n = \Phi_n(\mathcal C_1, \ldots, \mathcal C_n, \mathcal Z), \end{cases} where each of the expressions \Phi_k(\mathcal C_1, \ldots, \mathcal C_n, \mathcal Z) involves only disjoint union, cartesian product and sequence operator, then the corresponding Boltzmann sampler is well defined. Given the argument value z , the numerical values of the generating functions can be obtained by Newton iteration. C(z) = \sum_{c \in \mathcal C} \dfrac{z^{\omega(c)}}{\omega(c)!} = \sum_{n = 0}^\infty a_n \dfrac{z^n}{n!}, where a_n denotes the number of labelled objects c \in \mathcal C of size n . The operation of cartesian product and sequence need to be adjusted to take labelling into account, and the principle of construction remains the same. In the labelled case, the Boltzmann sampler for a labelled class \mathcal C is required to output an object c \in \mathcal C with probability \mathbb P(\Gamma \mathcal C(z) = c) = \frac{1}{C(z)} \frac{z^{\omega(c)}}{\omega(c)!}. C(z) = \sum_{k = 0}^\infty \dfrac{A(z)^k}{k!} = e^{A(z)} where A(z) is the exponential generating function of the class \mathcal A . The Boltzmann sampler for \mathcal C can be described as \Gamma \mathcal C(z) = \left( \operatorname{Poisson}(A(z)) \Longrightarrow \Gamma \mathcal C(z) \right) where \operatorname{Poisson}(\lambda) stands for the standard Poisson distribution \mathbb P(\operatorname{Poisson}(\lambda) = k) = e^{-\lambda} \dfrac{\lambda^k}{k!} . C(z) = \sum_{k = 0}^\infty \frac{A(z)^k}{k} = \log \frac{1}{1 - A(z)} where A(z) is the exponential generating function of the class \mathcal A . The Boltzmann sampler for \mathcal C can be described as \Gamma \mathcal C(z) = \left( \operatorname{Loga}(A(z)) \Longrightarrow \Gamma \mathcal C(z) \right) where \operatorname{Loga}(\lambda) describes the log-law distribution \mathbb P(\operatorname{Loga}(\lambda) = k) = \dfrac{1}{\log(1 - \lambda)^{-1}} \dfrac{\lambda^k}{k} . \mathbb E_z (N) = z \dfrac{C'(z)}{C(z)}; \mathbb E_z (N^2) = \dfrac{z^2 C(z) + z C'(z)}{C(z)}; z \dfrac{d}{dz} \mathbb E_z (N) = \operatorname{Var}_z (N) . \mathcal B = \mathcal Z + \mathcal Z \times \mathcal B \times \mathcal B and its generating function B(z) satisfies an equation B(z) = z + z B(z)^2 and can be evaluated as a solution of the quadratic equation B(z) = \dfrac{1 - \sqrt{1 - 4 z^2}}{2z} The resulting Boltzmann sampler can be described recursively by \Gamma \mathcal B(z) = \left( \operatorname{Bern}\left( \frac{z}{B(z)} \right) \longrightarrow \mathcal Z \mid \left( \mathcal Z, \, \Gamma \mathcal B(z), \, \Gamma \mathcal B(z) \right) \right) \mathcal C = \operatorname{Set}(\operatorname{Set}_{>0}(\mathcal Z)). The corresponding generating function is equal to C(z) = e^{e^z - 1} . Therefore, Boltzmann sampler can be described as \Gamma \mathcal C = \left( \operatorname{Poisson}(e^z - 1) \Longrightarrow \left( \operatorname{Poisson}_{>0} (z) \Longrightarrow \mathcal Z \right) \right), where the positive Poisson distribution \operatorname{Poisson}_{>0}(\lambda) is a Poisson distribution with a parameter \lambda conditioned to take only positive values. Let \mathcal C be a labelled combinatorial class. The derivative operation is defined as follows: take a labelled object c \in \mathcal C and replace an atom with the largest label with a distinguished atom without a label, therefore reducing a size of the resulting object by 1. If C(z) = \sum_{n=0}^\infty a_n \dfrac{z^n}{n!} is the exponential generating function of the class \mathcal C , then the exponential generating function of the derivative class \mathcal C' is given by C'(z) = \dfrac{d}{dz} C(z) = \sum_{n = 0}^\infty n a_n \frac{z^{n-1}}{n!} A differential specification is a recursive specification of type \mathcal T' = \Phi(\mathcal T, \mathcal Z) where the expression \Phi(\mathcal T, \mathcal Z) involves only standard operations of union, product, sequence, cycle and set, and does not involve differentiation. Boltzmann samplers for differential specifications have been constructed by Olivier Bodini, Olivier Roussel and Michèle Soria. A multi-parametric Boltzmann distribution for multiparametric combinatorial classes is defined similarly to the classical case. Assume that each object c \in \mathcal C is equipped with the composition size \omega(c) = (\omega_1(c), \ldots, \omega_d(c)) which is a vector of non-negative integer numbers. Each of the size functions \omega_j(c) can reflect one of the parameters of a data structure, such as the number of leaves of certain colour in a tree, the height of the tree, etc. The corresponding multivariate generating function C(z_1, \ldots, z_d) is then associated with a multi-parametric class, and is defined as C(z_1, \ldots, z_d) = \sum_{c \in \mathcal C} z_1^{\omega_1(c)} \cdots z_d^{\omega_d(c)}. A Boltzmann sampler for the multiparametric class \mathcal C with a vector parameter \boldsymbol z = (z_1, \ldots, z_d) inside the domain of analyticity of C(z_1, \ldots, z_d) , denoted as \Gamma \mathcal C(z_1, \ldots, z_d) returns an object c \in \mathcal C with probability \mathbb P( \Gamma \mathcal C(z_1, \ldots, z_d) = c) = \frac{z_1^{\omega_1(c)} \cdots z_d^{\omega_d(c)}}{C(z_1, \ldots, z_d)}. Multiparametric Boltzmann samplers have been constructed by Olivier Bodini and Yann Ponty. A polynomial-time algorithm for finding the numerical values of the parameters z_1, \ldots, z_d given the target parameter expectations, can be obtained by formulating an auxiliary convex optimisation problem Combstruct package in Maple: https://www.maplesoft.com/support/help/Maple/view.aspx?path=combstruct Haskell package Boltzmann Brain: https://github.com/maciej-bendkowski/boltzmann-brain

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Boltzmann sampler". 1759934464. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1315783570

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·