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
Use a distribution as choice map #530
Comments
Hi! Great question. Gen.jl doesn't have support for stochastic conditioning, but here's something you could do instead that comes close (but is not mathematically identical). I'm going to assume that your first model is "smaller" than your second model, in the sense that all random variables in the first model also exist in the second model. For example: Model 1: Now let's say you use a particle filter to approximate the posterior Furthermore, we can use the log marginal likelihood estimate All of this means we can use our particle filter as a proposal distribution for the value of
Do this I hope this helps! Some of this stuff is easier to implement using a variant of Gen called GenSP.jl (see https://github.com/probcomp/GenSP.jl), but everything I described above is possible to do using the existing functionality provided by Gen.jl. Besides using I would recommend checking out the source code of Gen.jl/src/inference/importance.jl Lines 38 to 59 in 7955b07
The main thing you have to modify is how the samples are proposed (by sampling from a particle filter, instead of using |
We are using particle filter in gen.
We want to use the posterior distribution from one model as a choice map to update another model. If we have 50 particles, we will get 50 observations for the same state at the same time. How shall we deal with this in Gen? Is that possible to implement something like stochastic conditioning?
Thanks a lot.
The text was updated successfully, but these errors were encountered: