Estimate sthe Gelman-Rubin (rhat) convergence statistic for a single parameter across multiple chains. Basic method, assuming all chains are of equal length

gelman_rubin(par_matrix, chains, samples)

Arguments

par_matrix

Matrix (interations x chains)

chains

number of chains

samples

number of samples

Value

Gelman-Rubin statistic

References

Gelman, A., and D. B. Rubin. 1992. Inference from Iterative Simulation Using Multiple Sequences. Statistical Science 7: 457–511.

https://astrostatistics.psu.edu/RLectures/diagnosticsMCMC.pdf