estimate_bayes_h: (Hierarchical) Bayesian Estimation with Differential...

View source: R/core_bayes_estimate.R

estimate_bayes_hR Documentation

(Hierarchical) Bayesian Estimation with Differential Evolution

Description

Estimate group-level and individual-level parameters with a hierarchical Bayesian approach using Differential Evolution MCMC (DE-MCMC) \insertCiteTurneretal.2013;textualdRiftDM. An approximation of the marginal likelihood to calculate Bayes Factors can be obtained with the Thermodynamic Integration via Differential Evolution (TIDE) sampler \insertCiteEvansAnnis2019;textualdRiftDM.

Usage

estimate_bayes_h(
  drift_dm_obj,
  obs_data_ids,
  sampler,
  n_chains,
  burn_in,
  samples,
  n_cores,
  prob_migration,
  prob_re_eval,
  verbose,
  seed = NULL,
  ...
)

estimate_bayes_one_subj(
  drift_dm_obj,
  sampler,
  n_chains,
  burn_in,
  samples,
  prob_migration,
  prob_re_eval,
  verbose,
  ...
)

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.

n_cores

numeric, number of threads to use for parallel processing in the hierarchical case. Default is 1.

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.

seed

optional random seed for reproducibility.

...

additional arguments passed to get_default_prior_settings to customize prior settings.

Details

The function estimate_bayes_h() handles the hierarchical case. The function estimate_bayes_one_subj() handles the case for estimating a single individual. The reason for writing two functions is that the hierarchical case has some unique tweaks to it that need to be considered ... and writing one function would be quite the mess.

Prior Settings: See the wrapper estimate_bayesian() and also get_default_prior_settings()

Value

A named ist containing posterior samples for group-level and individual-level parameters, log-posterior values, and log-likelihoods. Labels: phi, pis_phi, lls_phi, theta, pis_theta, lls_theta. The first three entries are only present in the hierarchical case.

The list also has an additional attribute named data_model. In the hierarchical case, the attribute contains a named list of model copies with all the individual data sets attached. The list is named according to the individual IDs in the argument obs_data_ids. In the non-hierarchical case, the attribute contains the model and its attached data.

References

\insertRef

Turneretal.2013dRiftDM \insertRefEvansAnnis2019dRiftDM


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