aesara-devs / aemcmc

AeMCMC is a Python library that automates the construction of samplers for Aesara graphs representing statistical models.
https://aemcmc.readthedocs.io/en/latest/
MIT License
39 stars 11 forks source link

Expand scale-mixtures #46

Open brandonwillard opened 2 years ago

brandonwillard commented 2 years ago

After #45, we need to add a scale-mixture-expansion step to the sampler-generating process.

We can start by implementing the Polya-gamma expansion for negative-binomials and Bernoulli random variables. This will work together to produce nbinom_normal_posterior and bern_normal_posterior in #45, after expansion and subsequent detection of the resulting normal-normal posterior.

On a related note, we'll need to start walking through "graph rewrite space" in a more reasonable way. For instance, a scale-mixture expansion might aid in the construction of a sampler where one wasn't possible before (e.g. we don't have a sampler for the unexpanded term in our "database"). On the other hand, when there is a sampler for a term that can be expanded, we will need to consider the samplers resulting from both expanding and not expanding.

brandonwillard commented 2 years ago

A directly relevant Discussion has been started here: https://github.com/aesara-devs/aesara/discussions/1082#org8a1a145.