Skip to content

Instantly share code, notes, and snippets.

@AustinRochford
Created July 30, 2017 15:00
Show Gist options
  • Save AustinRochford/9e4f26905647be1f359054bcb569f599 to your computer and use it in GitHub Desktop.
Save AustinRochford/9e4f26905647be1f359054bcb569f599 to your computer and use it in GitHub Desktop.
Generalized Mixture Model Component Parameters
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rpgoldman
Copy link

rpgoldman commented Mar 30, 2018

As I understand your gist in 7, \pi supplies the weights and mu provides the means for the poisson distribution. But what if I wanted to see the Poisson values in the trace? I could do:

poisson = pm.Poisson('My Poisson variable', mu)

but then I can't pass poisson in to pm.Mixture because (apparently) it's not a dist. It really isn't clear to me what is the distinction between the normal constructor -- pm.Poisson() -- and the dist method -- pm.Poisson.dist().

I have tried, but I don't see any explanation in the pymc3 docs. Thanks!
Update: I did find the explanation of the dist() class method here: https://docs.pymc.io/prob_dists.html but it doesn't really help me. Since the dist object is outside the model, I don't know how to find it in a trace. Also, there isn't an obvious way to extract a dist from a Distribution which makes this all very puzzling. Any explanation would be very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment