You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Raftery-Lewis diagnostic for MCMC convergence isn’t well supported in Python. Importing the raftery.diag function from the R library coda into Python somewhat defeats the purpose of a Python port, so we could consider other (more widely used) diagnostics.
The text was updated successfully, but these errors were encountered:
I believe PyMC3 has the Gelman-Rubin diagnostic which detects convergence based on how similar the results from multiple MCMC chains are. Not sure if it is implemented within PyMC3 in the latest version, I think they have started using arviz (external library with close integration): https://arviz-devs.github.io/arviz/api/generated/arviz.rhat.html
Gelman Rubin I think is a widely used diagnostic in MCMC literature, I do not remember encountering Raftery-Lewis a lot.
Comments from Oscar Giles:
I think Raftery-Lewis is getting at something a bit different from Gelmen Rubin so other statistics might not cover the use case. Rather than “have i converged?” it asks “how many iterations do i think i would need to converge?”.
Asking that question makes sense when running your models is very costly because:
each iteration takes a long time
your algorithm is producing highly auto-correlated chains so you need more samples to get good precision
you don’t have much memory so you might want to use thinning and you need to figure out what you could get away with
The other approach would be to run a lot of iterations and then estimate precision after the fact (with something like https://mc-stan.org/posterior/reference/mcse_quantile.html). Then rerun with more iterations if you didn’t do well enough.
I suspect that Raftery-Lewis is not used much now because the second approach is now often feasible - computers faster/plenty memory/more efficient algorithms (like NUTS/HMC in Pymc3).
The Raftery-Lewis diagnostic for MCMC convergence isn’t well supported in Python. Importing the
raftery.diag
function from the R librarycoda
into Python somewhat defeats the purpose of a Python port, so we could consider other (more widely used) diagnostics.The text was updated successfully, but these errors were encountered: