Creates list or generates a plot of prior samples

sample_priors(priors, n_samples = 10000, plot = "ggplot")

Arguments

priors

An object of class brmsprior from package brms.

n_samples

The number of prior samples to return.

plot

NA returns a list of numeric vectors of sampled priors, "ggplot" (default) returns a ggplot and "base" returns a histogram in base R.

Value

A list containing the initialisation values.

See also

Examples

library(bayesnec)
data(manec_example)
exmp <- pull_brmsfit(manec_example, model = "nec4param")
sample_priors(exmp$prior)
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.