Skip to content
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

observe vs observe* and sample vs sample* #8

Open
phsamuel opened this issue May 30, 2019 · 0 comments
Open

observe vs observe* and sample vs sample* #8

phsamuel opened this issue May 30, 2019 · 0 comments

Comments

@phsamuel
Copy link

I am quite confused with the difference between the * and non-star version. In the documentation, it mentioned that observe*/sample* is anglican version and observe/sample is the clojure version. So I thought former two are always preferred. But when I tried to go through this HW exercise from the UBC course, observe* just doesn't work. More precisely, when I tried to create a query of a twice observed Gaussian model,

(defquery gaussian-model [y1 y2]
(let [mu (sample (normal 1 (sqrt 5))) ; prior mean distributed with mean 1 and variance 5
mygauss (normal mu (sqrt 2))]
(observe mygauss y1) ; observe work but observe* doesnt
(observe mygauss y2)
mu))

the above works but when observe replaced by observe*, it doesn't result in the correct estimate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant