Skip to content

Commit

Permalink
improve docs for GPSS
Browse files Browse the repository at this point in the history
  • Loading branch information
Red-Portal committed Aug 11, 2024
1 parent 38f696a commit 825cd27
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/src/gibbs_polar.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,16 @@ model = demo()
n_samples = 1000
latent_chain = sample(model, externalsampler(LatentSlice(10)), n_samples; initial_params=ones(10))
polar_chain = sample(model, externalsampler(GibbsPolarSlice(10)), n_samples; initial_params=ones(10))
stephist( rand(TDist(1), 10000), bins=-10:1:10, normed=true, label="true", linewidth=3)
stephist!(latent_chain[:,1,:], bins=-10:1:10, fill=true, alpha=0.5, normed=true, label="LSS")
stephist!(polar_chain[:,1,:], bins=-10:1:10, fill=true, alpha=0.5, normed=true, label="GPSS")
l = @layout [a; b]
p1 = Plots.plot(1:n_samples, latent_chain[:,1,:], ylims=[-10,10], label="LSS")
p2 = Plots.plot(1:n_samples, polar_chain[:,1,:], ylims=[-10,10], label="GPSS")
plot(p1, p2, layout = l)
savefig("student_latent_gpss.svg")
```
![](student_latent_gpss.svg)

Clearly, for 1000 samples, GPSS is mixing much quicker than the [latent slice sampler](@ref latent) (LSS) at a similar per-iteration cost.
Clearly, GPSS is better at exploring the deep tails compared to the [latent slice sampler](@ref latent) (LSS) despite having a similar per-iteration cost.


[^SHR2023]: Schär, P., Habeck, M., & Rudolf, D. (2023, July). Gibbsian polar slice sampling. In International Conference on Machine Learning.
Expand Down

0 comments on commit 825cd27

Please sign in to comment.