I am looking for libraries available from Python to compute marginals on an undirected graphical model (i.e. a random field) with loops.

Some algorithms for this could be LBP (loopy belief propagation) or GBP (generalized belief propagation), although I don't need to use a specific algorithm.

I checked SciKit learn but they don't seem to have much for graphical models.


Have a look at PyMC (documentation is available as pdf and html)

See also this section on using arbitrary factors.

  • $\begingroup$ Thanks! On a quick look I didn't see anything to compute marginals. Perhaps I missed it? $\endgroup$ – Amelio Vazquez-Reina Dec 11 '12 at 18:26
  • 1
    $\begingroup$ for the example in the tutorial, the plotting of the marginal posterior distribution for one of the parameters is shown in section 3.5.3 $\endgroup$ – Andre Holzner Dec 11 '12 at 19:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.