Create a data structure that contains all required data and functions for priorsense
create_priorsense_data(x, ...)# S3 method for default
create_priorsense_data(
x,
fit = NULL,
log_prior_fn = log_prior_draws,
log_lik_fn = log_lik_draws,
log_prior = NULL,
log_lik = NULL,
log_ratio_fn = NULL,
log_prior_name = "lprior",
log_lik_name = "log_lik",
...
)
# S3 method for stanfit
create_priorsense_data(x, ...)
# S3 method for CmdStanFit
create_priorsense_data(x, ...)
# S3 method for draws
create_priorsense_data(x, ...)
# S3 method for rjags
create_priorsense_data(x, ...)
A priorsense_data
object, which contains the data and
functions to run sensitivity analyses.
an object for which the method is defined or an object coercible to a posterior::draws
object
arguments passed to methods
a model fit object (only used if x is not a fit object)
function to derive log prior from x or fit (if not NULL)
function to derive log likelihood from x or fit (if not NULL)
draws object from log prior, must be numeric and not include NA, NaN, Inf, -Inf or be constant
draws from log likelihood, must be numeric and not include NA, NaN, Inf, -Inf or be constant
function for moment matching
Character (case sensitive) specifying name of the variable storing the log prior evaluations
Character (case sensitive) specifying name of the variable storing the log likelihood evaluations
x <- example_powerscale_model()
drw <- x$draws
psd <- create_priorsense_data(drw)
Run the code above in your browser using DataLab