powered by
The distribution can be extracted as:
a probability density function ("continuous").
a probability mass function ("discrete").
a series of equal-tailed confidence/credible intervals ("eti").
a series of highest density confidence/credible intervals ("hdi").
extract_distribution( object, parName = "", type = c("continuous", "discrete", "eti", "hdi"), transform = identity, ... )
Object specifying the distribution as samples: can be a Stanfit object, a matrix (columns represents parameters, rows samples) or a vector.
Name of the parameter to extract.
Indicates how the distribution is summarised.
Function to apply to the samples.
Arguments to pass to extract_pmf(), extract_pdf() or extract_ci() depending on type.
extract_pmf()
extract_pdf()
extract_ci()
type
Dataframe
This function can notably be used to prepare the data for plotting fan charts when type = "eti" or "hdi". In that case, the ggdist package offers an alternative with ggdist::stat_lineribbon().
ggdist
ggdist::stat_lineribbon()
extract_draws() for extracting draws of an object.
extract_draws()
# NOT RUN { extract_distribution(runif(1e2), type = "continuous", support = c(0, 1)) # }
Run the code above in your browser using DataLab