This function computes the Gelman-Rubin statistic R_hat.
R_hat(samples, parts =2)
Arguments
samples: A vector or a matrix of samples from a Markov chain, e.g. Gibbs samples. If samples is a matrix, each column gives the samples for a separate run.
parts: The number of parts to divide each chain into sub-chains.