This package is licensed under GPL-3, because its dependency PolyaGammaHybridSamplers is. The engine and the other rule packages are MIT and do not depend on it.
The Pólya-Gamma augmented nodes for count data through the logistic, whose messages towards the weights are normal:
BinomialPolya,y ~ Binomial(n, σ(xᵀβ)): binomial and logistic regression, underBinomialPolyaApproximation(; samples = nothing);MultinomialPolya,x ~ Multinomial(N, p(ψ))by logistic stick-breaking: multinomial regression, underMultinomialPolyaApproximation(; points = 21).
Both algorithms are the nodes' defaults. The rules towards the weights read the message on the weights' own edge, which a model must initialise.
using PolyaMessagePassingRules, MessagePassingRulesBase, BayesBase, ExponentialFamily
result = @call_message_update_rule(
node = BinomialPolya, target = :β,
q = (y = PointMass(3), x = PointMass([0.1, 0.2]), n = PointMass(5)),
m = (β = MvNormalWeightedMeanPrecision(zeros(2), [1.0 0.0; 0.0 1.0]),),
)
getresult(result) # MvNormalWeightedMeanPrecision, ξ = (3 - 5/2) x, Λ = (5/4) x xᵀimport Pkg; Pkg.add("PolyaMessagePassingRules")- Documentation: https://reactivebayes.github.io/PolyaMessagePassingRules.jl/stable/.
make docsbuilds it locally, intodocs/build. - Tests:
make testruns the suite as CI does, ending with the rule-coverage gate: every rule must be selected by some test.make test test_args="name:rules"selects items by tag, by name or by file;make helplists the other targets. - Julia 1.10 or later. Licence: GPL-3.