Skip to main content

Module multinomial_posterior

Module multinomial_posterior 

Source
Expand description

Deterministic posterior moments for logistic-normal softmax probabilities.

A reference-coded multinomial model has M = K - 1 active logits. At one prediction row the Laplace posterior induces

eta ~ Normal(mu, V),
p(eta) = softmax(eta_0, ..., eta_{M-1}, 0).

This module computes E[p] and Cov(p) rather than the plug-in quantity softmax(E[eta]). The binary case is reduced to the controlled scalar logistic-normal evaluator in gam-solve. For K > 2, the covariance is eigendecomposed and quadrature is performed only over its positive range. Successive Smolyak levels built from odd-order Gauss-Hermite rules provide a deterministic error check. Failure to establish the requested tolerance is an error; there is deliberately no Monte Carlo or plug-in fallback.

Structs§

MultinomialPosteriorIntegrationControl
Explicit accuracy and work controls for multinomial posterior integration.
MultinomialPosteriorMoments
Integrated class-probability moments for one prediction row.
MultinomialPosteriorRowMoments
Integrated posterior means and marginal standard deviations for every row of a multinomial prediction design.

Functions§

integrate_logistic_normal_softmax_moments
Integrate reference-coded logistic-normal softmax moments for one row.
integrate_multinomial_design_moments
Integrate the logistic-normal posterior induced by a coefficient mode and its full joint covariance over every design row.