Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
fix ESS now Tail and Bulk (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
storopoli authored Mar 4, 2023
1 parent 7e745e0 commit b0b350e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _literate/05_MCMC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ summarystats(chain_met)

# $$ \text{efficiency} = \frac{\text{ESS}}{\text{iterations}} \label{ESS} $$

mean(summarystats(chain_met)[:, :ess]) / S
mean(summarystats(chain_met)[:, :ess_tail]) / S

# Our Metropolis algorithm has around 10.2% efficiency. Which, in my honest opinion, *sucks*...(😂)

Expand Down Expand Up @@ -671,7 +671,7 @@ summarystats(chain_gibbs)
# the ESS by the number of sampling iterations that we've performed also
# accounting for the `S * 2`:

(mean(summarystats(chain_gibbs)[:, :ess]) / 2) / S
(mean(summarystats(chain_gibbs)[:, :ess_tail]) / 2) / S

# Our Gibbs algorithm has around 10.6% efficiency. Which, in my honest opinion, despite the
# small improvement still *sucks*...(😂)
Expand Down Expand Up @@ -1048,7 +1048,7 @@ summarystats(chain_hmc)
# Now let's calculate the efficiency of our HMC algorithm by dividing
# the ESS by the number of sampling iterations:

mean(summarystats(chain_hmc)[:, :ess]) / S
mean(summarystats(chain_hmc)[:, :ess_tail]) / S

# We see that a simple naïve (and not well-calibrated[^calibrated]) HMC has 70% more efficiency from both Gibbs and Metropolis.
# ≈ 10% versus ≈ 17%. Great! 😀
Expand Down

0 comments on commit b0b350e

Please sign in to comment.