Skip to contents

Obtain the default priors for a Bayesian multilevel measurement model, as well as information for which parameters priors can be specified. Given the model, the data and the formula for the model, this function will return the default priors that would be used to estimate the model. Additionally, it will return all model parameters that have no prior specified (flat priors). This can help to get an idea about which priors need to be specified and also know which priors were used if no user-specified priors were passed to the fit_model() function.

Usage

get_model_prior(formula, data, model, ...)

Arguments

formula

An object of class bmmformula. A symbolic description of the model to be fitted.

data

An object of class data.frame, containing data of all variables used in the model. The names of the variables must match the variable names passed to the bmmmodel object for required argurments.

model

A description of the model to be fitted. This is a call to a bmmmodel such as mixture3p() function. Every model function has a number of required arguments which need to be specified within the function call. Call supported_models() to see the list of supported models and their required arguments

...

Further arguments passed to brms::get_prior(). See the description of brms::get_prior() for more details

Value

A data.frame with columns specifying the prior, the class, the coef and group

for each of the priors specified. Separate rows contain the information on the parameters (or parameter classes) for which priors can be specified.

Details

The following models are supported:

  • IMMabc(resp_err, nt_features, setsize, regex)

  • IMMbsc(resp_err, nt_features, nt_distances, setsize, regex)

  • IMMfull(resp_err, nt_features, nt_distances, setsize, regex)

  • mixture2p(resp_err)

  • mixture3p(resp_err, nt_features, setsize, regex)

  • sdmSimple(resp_err)

Type ?modelname to get information about a specific model, e.g. ?IMMfull

Type help(package=bmm) for a full list of available help topics.

Examples

if (FALSE) {
# generate artificial data from the Signal Discrimination Model
dat <- data.frame(y = rsdm(n=2000))

# define formula
ff <- bmf(y ~ 1,
          c ~ 1,
          kappa ~ 1)

# fit the model
get_model_prior(formula = ff,
                data = dat,
                model = sdmSimple()
)
}