I am working an adrift diffusion model and am running into an issue setting up priors.I recently made a post where, with the help of another forum user, I’ve decided my model formula should look like this:
formula <- brms::bf(
# drift rate formula
rt | dec(response) ~ x1+ x2+ (x2|p|subID) + (1|Face),
# boundary separation formula
bs ~ 1 + (1|p|subID),
# non-decision time formula
ndt ~ 1 + (1|p|subID),
# starting point formula
bias ~ 1 + (1|p|subID)
)
Where x1 is a continuous predictor and x2 is a categorical (with three levels, treatment-coded) of drift rate, and all other parameters are fixed.
To set up my priors, I decided to attempt using the default priors for most, specifying priors only for x1 and x2. My code is:
#What do the default priors look like?
get_prior(formula,
data = data,
family = wiener(link_bs = "identity",
link_ndt = "identity",
link_bias = "identity"))
The output is the following table:
Prior | class | coef | group | resp | dpar | nlpar | lb | ub | source |
---|---|---|---|---|---|---|---|---|---|
b | default | ||||||||
b | x2level2 | default | |||||||
b | x2level3 | default | |||||||
b | x1 | default | |||||||
lkj(1) | cor | default | |||||||
cor | subID | default | |||||||
student_t(3, 869, 431.4) | Intercept | default | |||||||
student_t(3, 0, 431.4) | sd | 0 | default | ||||||
sd | Stimulus | default | |||||||
sd | Intercept | Stimulus | default | ||||||
sd | subID | default | |||||||
sd | x2level2 | subID | default | ||||||
sd | x2level3 | subID | default | ||||||
sd | Intercept | subID | default | ||||||
beta(1, 1) | Intercept | bias | default | ||||||
student_t(3, 0, 431.4) | sd | bias | 0 | default | |||||
sd | subID | bias | default | ||||||
sd | Intercept | subID | bias | default | |||||
gamma(1, 1) | Intercept | bs | default | ||||||
student_t(3, 0, 431.4) | sd | bs | 0 | default | |||||
sd | subID | bs | default | ||||||
sd | Intercept | subID | bs | default | |||||
uniform(0, min_Y) | Intercept | ndt | default | ||||||
student_t(3, 0, 431.4) | sd | ndt | 0 | default | |||||
sd | subID | ndt | default | ||||||
sd | Intercept | subID | ndt | default |
I noticed it did not establish priors for x1 or x2, so I wrote more code to include those:
family <- wiener(link_bs = "identity",
link_ndt = "identity",
link_bias = "identity")
prior <- c(
set_prior("normal(-5, 5)", coef = "x2level1", class="b"),
set_prior("normal(-5, 5)", coef = "x2level2", class="b"),
set_prior("normal(-5, 5)", coef = "x1", class = "b")
) |> brms::validate_prior(formula,
family = family,
data = data)
make_stancode(formula,
family = wiener(link_bs = "identity",
link_ndt = "identity",
link_bias = "identity"),
data = data,
prior = prior)
When I try to create the stan code, I get the following error:
Warning messages:
1: It appears as if you have specified a lower bounded prior on a parameter that has no natural lower bound.
If this is really what you want, please specify argument 'lb' of 'set_prior' appropriately.
Warning occurred for prior
Intercept_bias ~ beta(1, 1)
Intercept_bs ~ gamma(1, 1)
Intercept_ndt ~ uniform(0, min_Y)
2: It appears as if you have specified an upper bounded prior on a parameter that has no natural upper bound.
If this is really what you want, please specify argument 'ub' of 'set_prior' appropriately.
Warning occurred for prior
Intercept_bias ~ beta(1, 1)
Intercept_ndt ~ uniform(0, min_Y)
Obviously, some of my priors are not logical. I’m unfamiliar with Bayesian statistics in general, so I am still trying to get the hang of establish priors, in addition to being new to DDM and stan. I have little help outside of this forum, so any assistance is greatly appreciated!