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.
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
andbern_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.