Skip to contents

The convergence diagnostic of Vehtari, Gelman, Simpson, Carpenter and Burkner (2021): each chain is split in half, the pooled draws are replaced by normal scores of their ranks, and the classic potential scale reduction of Gelman and Rubin (1992) is computed on those scores and on the scores of the folded draws |x - median| (the median of ALL draws, taken before the split); the larger of the two is returned. It is posterior::rhat() to rounding. Values above 1.01 call for attention, but at low effective sample size they are expected even from converged chains (R-hat^2 is about 1 + 2M/ESS): mcmc_diagnostics() reads the two together.

Usage

rhat(x)

Arguments

x

matrix of draws, one column per chain (a vector is one chain), at least 4 draws per chain

Value

a single number.

References

Gelman, A. & Rubin, D.B. (1992). Inference from iterative simulation using multiple sequences. Statistical Science 7:457-472.

Vehtari, A., Gelman, A., Simpson, D., Carpenter, B. & Burkner, P.-C. (2021). Rank-normalization, folding, and localization: an improved R-hat for assessing convergence of MCMC. Bayesian Analysis 16:667-718.