R_hat function

Compute Gelman-Rubin statistic