Wiener drift diffusion model -- initialization errors

273 views
Skip to first unread message

Tor Tarantola

unread,
Dec 14, 2015, 7:54:12 AM12/14/15
to Stan users mailing list
Hi all,

I'm having a problem specifying a Wiener drift diffusion model. I'm attempting to specify the boundary separation using an intercept and a coefficient:

a ~ intercept + coefficient * value

The priors are specified as follows:

intercept_mean ~ normal(1,2)
intercept_sd ~ half-cauchy(0,1)
coefficient_mean ~ normal(0,1)
coefficient_sd ~ half-cauchy(0,0.5)

intercept_a <- pow((intercept_mean / intercept_sd),2)
intercept_b <- intercept_mean / pow(intercept_sd, 2)

intercept ~ gamma(intercept_a, intercept_b)
coefficient ~ normal(coefficient_mean, coefficient_sd)

"Value" is bounded (-1,1). The model is hierarchical, and allows all four drift parameters to vary freely. Initialization is failing because too many proposals are being rejected due to the boundary separation being negative. I've tried constraining the prior for the coefficient so it's less likely to exceed the intercept (see above), but I'm concerned about constraining it too much. Is there a good way to get around this problem (or override the 100 attempts limit)? Any advice much appreciated!

Best,
Tor


----
Tor Tarantola
PhD Candidate in Psychology
University of Cambridge
Department of Psychology
Downing Street
Cambridge CB2 3EB
United Kingdom

Daniel Lee

unread,
Dec 14, 2015, 11:09:05 AM12/14/15
to stan-users mailing list
Hi Tor,

Can you send the complete Stan program? It's hard to piece together what you're doing when it's not clear what are data and parameters and how the parameters are declared.



Daniel


--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joachim Vandekerckhove

unread,
Dec 14, 2015, 2:16:39 PM12/14/15
to Stan users mailing list
You could try something like: log(a) ~ intercept + coefficient * value

Tor Tarantola

unread,
Jan 11, 2016, 5:52:37 AM1/11/16
to stan-...@googlegroups.com
Hi both,

Thanks very much for your messages. I've tried a log transformation, but the errors are replaced with log(0) initialization errors. I'm attaching the full model. You'll see that it's a Q-learning model, so the threshold term (a) is a function of an intercept and the difference in learned values (q[2] - q[1]), which is weighted by a coefficient. This value difference is naturally bounded between -1 and 1.

Thanks again for any advice!

Best,
Tor



--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/1y1uWCWf55o/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
model_drift_null.stan.cpp

Guido Biele

unread,
Jan 11, 2016, 8:38:05 AM1/11/16
to Stan users mailing list, tor.ta...@gmail.com
not sure if the following is useful, because it appears you defined
q[1] and q[2] as values for the wrong (low value) and correct 
(high value) options. 

still, stochastic payoffs will likely make that sometimes q[1] > q[2];

therefore, if boundary separation shall depend on the difficulty of 
the choice, the absolute of the value difference should work.
a <- threshold_int[s] + ( threshold_learning[s] * abs(q[2]-q[1]) );

guido

Tor Tarantola

unread,
Jan 11, 2016, 10:14:23 AM1/11/16
to Guido Biele, Stan users mailing list
Hi Guido,

Thanks very much for pointing this out! I've made the change, but unfortunately I'm still getting the same error due to the number of times the initial values for the intercept (threshold_int) and coefficient (threshold_learning) result in a negative value for 'a.' Is there any way to add a relative constraint to the parameters (e.g. threshold_learning has a lower bound of -threshold_int)?

Tor

Guido Biele

unread,
Jan 12, 2016, 3:06:22 AM1/12/16
to Stan users mailing list, guido...@gmail.com, tor.ta...@gmail.com
I guess the problem is that given how you have set up your model 
it easily happens that

threshold_int[s] < threshold_learning[s] * abs(q[2]-q[1])

I think you could either use priors to make sure that
threshold_int is relatively large.
Instead I would do what Joachim suggested;

threshold_int <- exp(threshold_int[s]threshold_learning[s] * abs(q[2]-q[1]))

one other thing that can happen is that t_er gets larger
than your smallest RT, which will also lead log_prob values of -Inf.
One way to deal with this is to constrain t_er to be maximally the fastest RT.

Guido

Bob Carpenter

unread,
Jan 12, 2016, 2:55:17 PM1/12/16
to stan-...@googlegroups.com
Absolute values are tricky on parameters because they wind up
providing multimodal answers at alpha and -alpha by definition.

If there's an actual constraint, it's better to put it in
the model rather than try to compensate with something like absolute
value. (I hope I understood the problem.)

- Bob
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.

Bob Carpenter

unread,
Jan 12, 2016, 2:56:17 PM1/12/16
to stan-...@googlegroups.com
If you just want q[2] > q[1], then


ordered q[2];

will work, though it'll be q[1] > q[2]. We also have positive_ordered
if you also have q[2] > q[1] > 0.

- Bob
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.

Guido Biele

unread,
Jan 13, 2016, 2:42:19 AM1/13/16
to Stan users mailing list
Bob:

q1 and q2 are not parameters. 
they are reward expectations learned in an experiment 
where  subjects learn from feedback how valuable two 
choice alternatives are.

in this context, abs(q[1]-q[2]) serves as an indicator of
decision difficulty, i.e. choices are more difficult when 
abs(q[1]-q[2]) is small.

It is a common assumption that people take more time 
to make choices when they are difficult (commonly 
referred to as speed accuracy trade-off). When modelling 
choices with the the wiener distribution (which should be 
renamed to wiener first passage tome distribution ...) this 
can be achieved by making the boundary separation 
parameter of the wiener fpt distribution dependent on 
ab(q[2]-q[1])

Guido

PS: 
Tor:
A student of mine has implemented combined RL-DDM models
(in jags) and he found that making boundary separation dependent 
on the absolute difference of Q values did not make the model fit
noticeably better.

Tor Tarantola

unread,
Jan 20, 2016, 11:18:23 AM1/20/16
to Stan users mailing list
Hi all,

It looks like the main problem was the lack of constraint on the non-decision time (like you mentioned, Guido). I think too many initial proposals exceeded the total RTs for a few trials. I've made the non-decision time parameters non-hierarchical (one for each subject) and set the upper bound for each to the minimum RT for that subject. It seems to be working now, even without log transforming the threshold, and keeping the absolute value on the Q difference. Thanks very much for your help.

-Tor
Reply all
Reply to author
Forward
0 new messages