plot_posterior_stan {makemyprior}R Documentation

Plotting posterior distributions

Description

Function for plotting the posterior distributions of the random effect variances on the scale of the tree parameterization.

Usage

plot_posterior_stan(
  obj,
  param = c("prior", "variance", "stdev", "precision"),
  prior = FALSE
)

Arguments

obj

An object from inference_stan

param

A string indicating parameterization of plot. "prior" for scale of parameters, "variance", "stdev" and "precision" also possible.

prior

Include prior in the plot? Only possible for param = "prior". Note that if Jeffreys' prior is used for the total variance, it will not be included in the plot.

Value

A ggplot with the posterior distributions. See also makemyprior_plotting.

Examples



if (interactive() && requireNamespace("rstan")){
  ex_prior <- makemyprior_example_model()
  res_stan <- inference_stan(ex_prior, iter = 100)
  # Note: For reliable results, increase the number of iterations (e.g., 'iter = 2000')
  plot_posterior_stan(res_stan)
}


[Package makemyprior version 1.2.1 Index]