Description Usage Arguments Value Details Examples
View source: R/post_estimation.R
point_est
is used to calculate point estimates and credible intervals
for the parameters of interest to the user.
1 |
posterior |
object of class |
pars |
character vector, a vector of model parameter names e.g.
|
prob |
numeric, a number between 0 and 1 indicating the probability mass to include in the credible interval. Defaults to 0.9. |
Returns a three-columm matrix containing the median of the posterior of each parameter of interest and the lower and upper quantile to form a credible interval around the median.
point_est
is a helper function for users to quickly caluclate the
median of the posterior for parameters of interest, and credible intervals
for those parameters with quantiles defined by the user. These estimates 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(5, 20)
posterior <- mediascores(Y = simulated_data$Y, group = simulated_data$group,
anchors = simulated_data$anchors,
variational = FALSE, chains = 1, iter = 500)
point_est(posterior, pars = c("theta", "theta_mu"), prob = 0.90)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.