probcomp / Venturecxx

Primary implementation of the Venture probabilistic programming system
http://probcomp.csail.mit.edu/venture/
GNU General Public License v3.0
28 stars 6 forks source link

Plan to fix conjugate dirichlet problems #453

Open axch opened 8 years ago

axch commented 8 years ago

Our dirichlet-categorical woes, namely #407, #451, and #452, are ultimately due to representing the probabilities in terms of the indexes of the options rather than in terms of their actual values. Changing the representation to values is slightly tricky, but doable.

The plan:

Doing all this for Puma is #340.

[Edited: Replaced "multinomial" with "categorical" in names, pursuant to #450.]

lenaqr commented 8 years ago

The operation we actually want for dirichlet multinomial accepts two such trees of total size O(n), (the counts and the pseudo-counts) with potentially repeated elements, and samples an element proportional to its total weight in both trees, in O(log n).

Why not just sample one of the two trees proportional to their weight, then sample within the chosen tree in the straightforward way?

axch commented 8 years ago

Oh. Duh. That's even better.