MultinomialPolya node
The MultinomialPolya node implements a Multinomial likelihood with a softmax linear predictor, augmented with Pólya-Gamma auxiliary variables for tractable Bayesian inference:
\[x \mid N, \psi \sim \mathrm{Multinomial}\!\left(N,\; \mathrm{softmax}(\psi)\right)\]
where x is a count vector, N is the total number of trials, and ψ is a latent vector with a Normal prior.
Interfaces
| Interface | Role |
|---|---|
x | Observed count vector |
N | Total number of trials |
ψ | Softmax weight vector (Normal prior) |
The Pólya-Gamma augmentation trick
A Normal prior on ψ combined with a Multinomial likelihood through a softmax link is not conjugate. The Pólya-Gamma augmentation (Polson et al., 2013) uses a set of latent Pólya-Gamma variables — one per category — such that, conditional on these variables, the likelihood factorizes into a product of Gaussian terms. This restores conjugacy with the Normal prior on ψ and allows closed-form VMP updates.
The key advantage over Monte Carlo methods is that inference remains deterministic and converges smoothly, making it suitable for models where ψ is a latent variable that must be marginalized.
Typical use cases:
- Multinomial regression — predicting category counts from a feature vector.
- Topic models — where category probabilities are the softmax of a Gaussian-distributed topic vector.
Meta and tuning
MultinomialPolyaMeta controls the number of cubature points used to integrate out the Pólya-Gamma variables:
| Field | Default | Effect |
|---|---|---|
ncubaturepoints | 21 (MULTINOMIAL_POLYA_CUBATURE_POINTS) | More points → higher accuracy, higher cost. Reduce to 7 or 9 for faster but less accurate inference. |
The default of 21 cubature points balances accuracy and speed for typical problem sizes.
ReactiveMP.MultinomialPolya — Type
MultinomialPolyaA node type representing a MultinomialPolya likelihood with linear predictor through softmax. A Normal prior on the weights is used. The prior is augmented with a PolyaGamma distribution, which is used for modeling count data with overdispersion. This implementation follows the PolyaGamma augmentation scheme for Bayesian inference. Can be used for Multinomial regression. Uses cubature integration for the PolyaGamma augmentation scheme with a default of 21 points. Use MultinomialPolyaMeta to change the number of cubature points.
ReactiveMP.MultinomialPolyaMeta — Type
MultinomialPolyaMetaA structure that contains the meta-parameters for the MultinomialPolya node.
Fields
ncubaturepoints::Int: The number of cubature points used for integration in the PolyaGamma augmentation scheme.
ReactiveMP.MULTINOMIAL_POLYA_CUBATURE_POINTS — Constant
MULTINOMIAL_POLYA_CUBATURE_POINTSThe number of cubature points used for integration in the PolyaGamma augmentation scheme.