I am building a model of choice behavior based on published choice behavior (2 options) equations in the context of task data (120 trials, 4 runs of 30 trials). The goal is to estimate values for random effects used to define participant choice for each trial. The equation below defines the response space:
SV ~ [p - beta(A/2)] * V^alpha
p = objective probability (from task)
A = Ambiguity (from task)
V = Amount (from task)
alpha = random effect (individual specific parameter)
beta = random effect (individual specific parameter)
Choice ~ 1/(1 + exp^(lambda(SVa-SVb))
lambda = slope of logistic function (individual specific parameter)
SVa = SV for A = 0
SVb = SV for A > 0
I am relatively new to Bayesian/BRMS modeling, so I am still getting comfortable with the specification/coding of multilevel models, so all feedback is helpful. This was my first attempt to model the above problem and the estimation took about 4 hrs and I am not sure I translated it appropiately. The model didn’t mix well and Rhat values suggest I am misspecifying the model.
final_model <- brm(
bf(Choice ~ 1 + (1 / (1 + exp(lambda * (((P- beta (A=0/ 2))* V^alpha) - (P - beta(A>0/ 2))* V^alpha),
alpha ~ 1 + (1 | Subject),
beta ~ 1 + (1 | Subject),
lambda ~ 1 + (1 | Subject),
nl = TRUE),
data = DataFile,
family = binomial(),
prior = c(
set_prior("student_t(3, 1, 0.5)", nlpar = "alpha"), # t-distribution for alpha
set_prior("student_t(3, 0, 0.5)", nlpar = "beta"), # t-distribution for beta
set_prior("normal(0, 5)", nlpar = "lambda"), # Normal distribution for lambda
set_prior("normal(0, 5)", class = "sd", group = "Subject", coef = "Intercept", nlpar = "alpha"),
set_prior("normal(0, 1)", class = "sd", group = "Subject", coef = "Intercept", nlpar = "beta"),
set_prior("normal(0, 1)", class = "sd", group = "Subject", coef = "Intercept", nlpar = "lambda")
),
chains = 4,
iter = 8000,
control = list(adapt_delta = 0.99)
)
I am particularly interestested in how to estimate the trial by trial values for each of the random effects and realize that trial isn’t in my formula yet, but I plan to build this as I better understand how to estimate the hyperparameters in this type of model.