Skip to content

observe vs observe* and sample vs sample* #8

@phsamuel

Description

@phsamuel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions