Description Usage Arguments Value Details Examples
View source: R/post_estimation.R
rhat
calculates R-hat statistics for each specifide parameter of
interest.
1 |
posterior, |
object of class |
pars |
character vector, a vector of model parameter names e.g.
|
Returns a named vector of R-hat values for the parameters specified by the
pars
argument.
rhat
is a helper function for users to quickly caluclate a common
convergence statistic, R-hat, for each parameter. These statistics can
be calculated for the following parameters inputted (alone or in combination)
by the user: "theta", "theta_mu", "theta_sigma", "zeta", "alpha",
"alpha_mu", "alpha_sigma", "gamma", "gamma_sigma", "omega_domain",
"omega_user"
. Indexed variants of these parameter names can also be
retrieved (e.g. c("theta[4]", "zeta[1]")
.
1 2 3 4 5 6 7 8 | ## Not run:
simulated_data <- simulate_data()
posterior <- mediascores(Y = simulated_data$Y, group = simulated_data$group,
anchors = simulated_data$anchors,
variational = TRUE)
rhat(posterior, pars = c("theta", "zeta"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.