Calculates an R-hat (potential scale reduction factor) value.
# S3 method for class 'mcmcr'
rhat(x, by = "all", as_df = FALSE, na_rm = FALSE, ...)
A number >= 1 indicating the rhat value.
By default the uncorrected, unfolded, univariate, split R-hat value.
Gelman, A., and Rubin, D.B. 1992. Inference from Iterative Simulation Using Multiple Sequences. Statistical Science 7(4): 457–472.
Other convergence:
converged_pars()
,
converged_terms()
,
converged()
,
esr_pars()
,
esr_terms()
,
esr()
,
rhat_pars()
,
rhat_terms()
rhat(mcmcr_example)
#> [1] 2.002
rhat(mcmcr_example, by = "parameter")
#> $alpha
#> [1] 2.002
#>
#> $beta
#> [1] 1.147
#>
#> $sigma
#> [1] 1
#>
rhat(mcmcr_example, by = "term")
#> $alpha
#> [1] 2.002 2.002
#>
#> $beta
#> [,1] [,2]
#> [1,] 1.147 1.147
#> [2,] 1.147 1.147
#>
#> $sigma
#> [1] 1
#>
rhat(mcmcr_example, by = "term", as_df = TRUE)
#> # A tibble: 7 × 2
#> term rhat
#> <term> <dbl>
#> 1 alpha[1] 2.00
#> 2 alpha[2] 2.00
#> 3 beta[1,1] 1.15
#> 4 beta[2,1] 1.15
#> 5 beta[1,2] 1.15
#> 6 beta[2,2] 1.15
#> 7 sigma 1