LDDMM: Drift Diffusion Model Fit

View source: R/fcts.R

LDDMMR Documentation

Drift Diffusion Model Fit

Description

Main function for the Gibbs sampler for the drift-diffusion model. Note that priors are noninformative and calibrated so that, for the most stable performance, the response times (variable r_time in the data dataframe) should lie between 0 and 10.

Usage

LDDMM(
  data,
  hypers,
  boundaries = "flexible",
  Niter = 5000,
  burnin = 2000,
  thin = 5
)

Arguments

data

dataframe with the following columns:

  • subject: vector of size n containing the participant labels

  • block: vector of size n containing the training blocks (longitudinal units)

  • s: vector of size n containing the stimuli

  • d: vector of size n containing the decisions

  • r_time: vector of size n containing the response times. To avoid numerical issues, the unit of measurement should be such that the numerical values of most response times should lie between 0 and 10

  • cens: vector of size n containing the censoring indicators (1 censored, 0 non censored)

hypers

hyperparameters of the MCMC: list containing "s_sigma_mu" and "s_sigma_b", which are the smoothness parameters for drifts and boundaries, respectively)

boundaries

whether to fit the unrestricted model (flexible), assume constant boundaries over time (constant) or fix the boundaries to the same level across predictors (fixed)

Niter

total number of iterations

burnin

burnin of the chain

thin

thinning factor

Value

List with the following MCMC posterior samples:

  • post_mean_delta: posterior samples for the population offset parameters

  • post_mean_mu: posterior samples for the population drift parameters

  • post_mean_b: posterior samples for the population boundary parameters

  • post_ind_delta: posterior samples for the individual offset parameters

  • post_ind_mu: posterior samples for the individual drift parameters

  • post_ind_b: posterior samples for the individual boundary parameters

  • sigma2_mu_us: posterior samples for the random effects drift smoothness parameters

  • sigma2_mu_ua: posterior samples for the random effects drift variance parameters

  • sigma2_b_us: posterior samples for the random effects boundary smoothness parameters

  • sigma2_b_ua: posterior samples for the random effects boundary variance parameters

  • sigma2_1_mu: posterior samples for the drift smoothness parameters

  • sigma2_1_b: posterior samples for the boundary smoothness parameters

  • pred_ans: predicted population-level categories

  • pred_time: predicted population-level response times

  • pred_ans_ind: predicted individual-level categories

  • pred_time_ind: predicted individual-level response times


lddmm documentation built on June 7, 2023, 5:28 p.m.