estimate_bayesian: (Hierarchical) Bayesian Estimation

View source: R/core_bayes_estimate.R

estimate_bayesianR Documentation

(Hierarchical) Bayesian Estimation

Description

This function provides a wrapper around the implemented samplers for Bayesian inference in dRiftDM. For parameter estimation, Differential Evolution Markov-Chain Monte-Carlo (DE-MCMC) \insertCiteTurneretal.2013;textualdRiftDM is used. An approximation of the marginal likelihood to calculate Bayes Factors can be obtained with the Thermodynamic Integration via Differential Evolution (TIDE) sampler \insertCiteEvansAnnis2019;textualdRiftDM. However, TIDE is not yet supported fully, and is at an experimental stage.

Usage

estimate_bayesian(
  drift_dm_obj,
  obs_data_ids = NULL,
  sampler,
  n_chains,
  burn_in,
  samples,
  prob_migration,
  prob_re_eval,
  verbose = NULL,
  ...
)

Arguments

drift_dm_obj

an object of type drift_dm.

obs_data_ids

data.frame for the hierarchical case. An additional column ID is necessary that codes the individuals (see also obs_data).

sampler

character string, indicating the sampler to use. Must be either "DE-MCMC" (default) or "TIDE".

n_chains

numeric, number of chains for the MCMC-sampler. Default is 40.

burn_in

numeric, number of burn-in iterations. Default is 500.

samples

numeric, number of sampling iterations after burn-in. Default is 2000.

prob_migration

numeric, probability of performing a migration crossover step during burn-in. Default is 0.1 (i.e., 10%).

prob_re_eval

numeric, probability of re-evaluating the likelihood/posterior values of the previous iteration i-1 when deciding for the acceptance of the proposal in iteration i. Only considered during burn-in. Default is 0.1 (i.e., 10%).

verbose

integer, indicating verbosity of output: 0 (none), 1 (minimal text output), or 2 (text output and progress bar). Default is 2.

...

additional arguments passed forward to estimate_bayes_h() and estimate_bayes_one_subj().

Details

When a data.frame is supplied, a hierarchical approach to parameter estimation is done. In this case, the supplied data set must provide data for multiple individuals. To estimate the parameters for a single individual (i.e., pursue the non-hierarchical approach), then the supplied model drift_dm_obj must have data attached to it (see obs_data()).

Value

an object of type mcmc_dm containing posterior samples for parameters, log-posterior values, and log-likelihoods. In the hierarchical case, the respective values are available at both the group-level and the individual-level. The object contains two attributes: sampler and data_model. The former simply stores the type of sampler that was used and codes whether estimation was done in a hierarchical fashion or not. The latter either contains the model and the attached data (in the non-hierarchical case) or a named list of model copies with each individual's data attached.

References

\insertRef

Turneretal.2013dRiftDM \insertRefEvansAnnis2019dRiftDM

See Also

summary.mcmc_dm(), estimate_bayes_h(), estimate_bayes_one_subj()


dRiftDM documentation built on Dec. 1, 2025, 5:08 p.m.