-
Notifications
You must be signed in to change notification settings - Fork 419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have some trouble translating a model from PyMC3 #109
Comments
A better name for the variable |
Basically you specified a joint distribution (
So I guess instead of a single HMC that samples everything at once, you should use Gibbs like the PyMC3 tutorials did. |
I did try several configurations, but I kept getting python errors; it’s good to know that there was no way of succeeding with the HMC algorithm, thanks! I considered it an almighty algorithm. Perhaps I should take the Probabilistic Graphical Models specialization on Coursera. |
The pymc3 link you attached mentioned they used metropolis within Gibbs. If
you’re referring to zhusuan I think you need to specify each step (which
variable to sample, which sample algorithm to use) to implement a Gibbs
sampling procedure.
…On Wed, 20 Jun 2018 at 23:04, Jesús Irais González Romero < ***@***.***> wrote:
I did try several configurations; it’s good to know that there was no way
of succeeding with the HMC algorithm, thanks!
I didn’t see the Gibbs sampler in the docs.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#109 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AEMFIkhu8d8NwZnv9Zjfu2KtZsE0hOHfks5t-mSRgaJpZM4UuGD1>
.
|
I'm very excited for this library, so I really want to learn how to use it. I'm translating the example Cheating among students from PyMC3 to ZhuSuan, from the book Probabilistic Programming & Bayesian Methods for Hackers.
It is a clever solution for inferring how many students cheated on an exam. It involves a "privacy algorithm" where students answer whether they cheated with the truth or randomly according to the flipping of two coins.
First coin flip:
Second coin flip:
This way, we can't point to an individual student and claim that they cheated, since only the student knows the results of the coin flips. And so, their privacy remains protected.
After the survey, we observe that 35 students out of a 100 answered that they cheated. The inference problem is to infer the real probability of cheating. Note that even if no student cheated, we would expect that 25 students would answer that they cheated.
However, it seems I'm getting something wrong since my results don't look similar to the results obtained in the original code.
This is my graphical model (a running Jupiter Notebook for this code can be found here):
This is the code for the inference model:
And this is the code for running the inference:
If you have the time, I'll appreciate your help a lot.
The text was updated successfully, but these errors were encountered: