Skip to content

Commit

Permalink
Revert to original placement of sum_pₜ
Browse files Browse the repository at this point in the history
  • Loading branch information
sethaxen committed Jan 10, 2023
1 parent fb1c82a commit 96e6e98
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ess.jl
Expand Up @@ -284,13 +284,10 @@ function ess_rhat(

# sum correlation estimates
pₜ = ρ_even + ρ_odd
sum_pₜ = zero(pₜ)
sum_pₜ = pₜ

k = 2
while true
# update sum
sum_pₜ += pₜ

# compute subsequent autocorrelation of all chains
# by combining estimates of each chain
ρ_even = 1 - inv_var₊ * (W - mean_autocov(k, esscache))
Expand All @@ -305,6 +302,9 @@ function ess_rhat(
# generate a monotone sequence
pₜ = min(Δ, pₜ)

# update sum
sum_pₜ += pₜ

# update indices
k += 2
end
Expand Down

0 comments on commit 96e6e98

Please sign in to comment.