TuringLang / Turing.jl

Bayesian inference with probabilistic programming.
https://turinglang.org
MIT License
2.03k stars 218 forks source link

Particle Gibbs (PG) #333

Closed emilemathieu closed 7 years ago

emilemathieu commented 7 years ago

Hi all !

Would you have a bit of documentation or insights about what's implemented behind PG ? By reading the code I understood that it looks more like a conditional SMC.

In the article Particle Markov chain Monte Carlo methods section 2.4.3, Particle Gibbs is defined as

a Gibbs sampler which samples iteratively from p(θ|y1:T, x1:T) and p(x1:T |y1:T, θ) [...] with a special type of PMCMC update called the conditional SMC update.

but that's not what PG is doing. Base on the paper, the syntax could looks like

sampler = PG(1000, SMC(1, :x), HMC(1, 0.2, 3, :θ))

But maybe this is what is done in Turing with:

sampler = Gibbs(1000, PG(1, :x), HMC(1, 0.2, 3, :θ))

Is it ? If so, PG could be renamed CSMC.

Thanks for your help

yebai commented 7 years ago

Is it ? If so, PG could be renamed CSMC.

That's quite right. PG in Turing actually refers to CSMC. Gibbs is slightly more general than PG, since it allows combination of samples like Gibbs(HMC, HMC).

@xukai92 Do you think we can change the name of PG to CSMC? Or perhaps we can create an alias CSMC to PG to keep backward compatibility?

xukai92 commented 7 years ago

@yebai I feel having a type alias CSMC for PG is better.

emilemathieu commented 7 years ago

Like this ?

typealias CSMC PG
yebai commented 7 years ago

typealias CSMC PG

Yes, that should work.

emilemathieu commented 7 years ago

Ok, I'll create a PR with that line added in src/sampler/pgibbs.jl. How can I modify the wiki to make that clearer for everyone ?

yebai commented 7 years ago

How can I modify the wiki to make that clearer for everyone ?

I'll added you to collaborators, so you can edit the wiki.

emilemathieu commented 7 years ago

PR for review: https://github.com/yebai/Turing.jl/pull/342