marginal_inference
R/marginal-distributions.R
as_marginal_inference.Rd
Creates marginal model-averaged and conditional posterior distributions based on a BayesTools JAGS model, vector of parameters, formula, and a list of conditional specifications for each parameter. Computes inclusion Bayes factors for each marginal estimate via a Savage-Dickey density approximation.
as_marginal_inference(
model,
marginal_parameters,
parameters,
conditional_list,
conditional_rule,
formula,
null_hypothesis = 0,
normal_approximation = FALSE,
n_samples = 10000,
silent = FALSE,
force_plots = FALSE
)
model fit via the JAGS_fit function
parameters for which the the marginal summary should be created
all parameters included in the model_list that are
relevant for the formula (all of which need to have specification of
is_null_list
)
list of conditional parameters for each marginal parameter
a character string specifying the rule for conditioning. Either "AND" or "OR". Defaults to "AND".
model formula (needs to be specified if parameter
was part of a formula)
point null hypothesis to test. Defaults to 0
whether the height of prior and posterior density should be
approximated via a normal distribution (rather than kernel density). Defaults to FALSE
.
number of samples to be drawn for the model-averaged prior distribution
whether warnings should be returned silently. Defaults to FALSE
temporal argument allowing to generate conditional posterior samples suitable for prior and posterior plots. Only available when conditioning on a single parameter.
as_marginal_inference
returns an object of class 'marginal_inference'.