rhat | R Documentation |
Compute split Rhat statistic
rhat(chains)
chains |
A matrix (iterations x chains) or a data.frame with a 'chain' column and parameter columns. |
Uses the formula for split-Rhat proposed by Gelman et al. (2013).
Rhat value (matrix input) or named vector of Rhat values.
Gelman et al. (2013). Bayesian Data Analysis, 3rd Edition.
# Example with matrix
chains <- matrix(rnorm(3000), nrow = 1000, ncol = 3)
rhat(chains)
#' # Example with data frame
chains_df <- data.frame(
chain = rep(1:3, each = 1000),
param1 = rnorm(3000),
param2 = rnorm(3000)
)
rhat(chains_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.