DDM for yes-no choices; stimcoding correct model instantiation?

799 views
Skip to first unread message

Jan

unread,
Jan 15, 2014, 1:38:56 AM1/15/14
to hddm-...@googlegroups.com
Hello,

I have run a simple yes-no contrast detection experiment. 

Per subject I want to obtain: 
- two drift rate estimates: separately for yes- and no-choices
- a bias estimate. 

Hence, I tried to work with hddm.HDDMStimCoding, but I'm still confused about the correct instantiation of this model.

My data now looks as follows -- columns:
- subj_idx, with the subject indexes (0-23)
- response, with the subject's responses (1: 'yes, signal present!'; 0: 'no, signal not present!')
- stim, whether the response was correct (1: correct; 0: incorrect)
- rt, with the ft's (in seconds)  

Without first running 'hddm.utils.flip_errors(data)', I instantiate the model now like this:
model = hddm.HDDMStimCoding(data, stim_col='stim', depends_on={'v': 'response'}, include=('z'))
model.find_starting_values()
model.sample(1000, burn=50)

Again, all I'm interested in is two drift rate estimates, separately for yes- and no-choices, and a bias estimate.

Am I doing the correct thing? Thanks for your help!!

Cheers,

Jan Willem


PS: About the DDM for yes-no choices: I recently talked with Roger Ratcliff about the DDM of yes-no choices. He was totally on board with the idea that there is no fundamental difference between 2AFC and yes-no decisions. In fact many of their original tasks (e.g., lexical and memory decisions) were of the yes-no type. He also had the same assumption that there is a separate accumulator for no, and it seems common thinking in the math Psych community. Plus, there is now all the mounting physiology evidence for this idea. I'm curious to hear your take on this though.

Thomas Wiecki

unread,
Jan 15, 2014, 12:55:02 PM1/15/14
to hddm-...@googlegroups.com
Hi Jan,

On Wed, Jan 15, 2014 at 1:38 AM, Jan <jwd...@gmail.com> wrote:
Hello,

I have run a simple yes-no contrast detection experiment. 

Per subject I want to obtain: 
- two drift rate estimates: separately for yes- and no-choices
- a bias estimate. 

So if you want two separate drift-rates I don't think you want HDDMStimCoding. The point of StimCoding is that you assume the drift-rate for the yes-stimulus is the opposite of the no-stimulus if that makes sense. So if you really expect yes and no are not symmetrical use HDDM() using accuracy coding and put v to depend on stimulus type.

If you do think they are symmetrical use StimCoding in the way outlined below.

Hence, I tried to work with hddm.HDDMStimCoding, but I'm still confused about the correct instantiation of this model.

My data now looks as follows -- columns:
- subj_idx, with the subject indexes (0-23)
- response, with the subject's responses (1: 'yes, signal present!'; 0: 'no, signal not present!')
- stim, whether the response was correct (1: correct; 0: incorrect)

Here you should indicate what the correct response side should have been. So if the subject correctly answered 'no', stim should not code correct but rather 'no' (0) as well.
- rt, with the ft's (in seconds)  

Without first running 'hddm.utils.flip_errors(data)', I instantiate the model now like this:
model = hddm.HDDMStimCoding(data, stim_col='stim', depends_on={'v': 'response'}, include=('z'))
model.find_starting_values()
model.sample(1000, burn=50)

That part is correct.

Thomas

Again, all I'm interested in is two drift rate estimates, separately for yes- and no-choices, and a bias estimate.

Am I doing the correct thing? Thanks for your help!!

Cheers,

Jan Willem


PS: About the DDM for yes-no choices: I recently talked with Roger Ratcliff about the DDM of yes-no choices. He was totally on board with the idea that there is no fundamental difference between 2AFC and yes-no decisions. In fact many of their original tasks (e.g., lexical and memory decisions) were of the yes-no type. He also had the same assumption that there is a separate accumulator for no, and it seems common thinking in the math Psych community. Plus, there is now all the mounting physiology evidence for this idea. I'm curious to hear your take on this though.

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



--
Thomas Wiecki
PhD candidate, Brown University
Quantitative Researcher, Quantopian Inc, Boston

Jan Willem de Gee

unread,
Jan 16, 2014, 4:17:06 AM1/16/14
to hddm-...@googlegroups.com
Hey Thomas,

Thanks a lot for your fast and clear response!

So if you want two separate drift-rates I don't think you want HDDMStimCoding. The point of StimCoding is that you assume the drift-rate for the yes-stimulus is the opposite of the no-stimulus if that makes sense. So if you really expect yes and no are not symmetrical use HDDM() using accuracy coding and put v to depend on stimulus type.

Ok -- that works, and I get sensible results. Just one thing, I want to fit a drift rate separately for yes- and no-choices, so I will make 'v' dependent on 'choice', rather than on 'stimulus type'. That's ok right (from at least a technical perspective)?

Here you should indicate what the correct response side should have been. So if the subject correctly answered 'no', stim should not code correct but rather 'no' (0) as well.

Yes, this was the problem. Thanks for pointing this out.

Cheers,

Jan

Thomas Wiecki

unread,
Jan 16, 2014, 7:20:01 AM1/16/14
to hddm-...@googlegroups.com
On Thu, Jan 16, 2014 at 4:17 AM, Jan Willem de Gee <jwd...@gmail.com> wrote:
Hey Thomas,

Thanks a lot for your fast and clear response!

So if you want two separate drift-rates I don't think you want HDDMStimCoding. The point of StimCoding is that you assume the drift-rate for the yes-stimulus is the opposite of the no-stimulus if that makes sense. So if you really expect yes and no are not symmetrical use HDDM() using accuracy coding and put v to depend on stimulus type.

Ok -- that works, and I get sensible results. Just one thing, I want to fit a drift rate separately for yes- and no-choices, so I will make 'v' dependent on 'choice', rather than on 'stimulus type'. That's ok right (from at least a technical perspective)?

Yes, that's correct.

Here you should indicate what the correct response side should have been. So if the subject correctly answered 'no', stim should not code correct but rather 'no' (0) as well.

Yes, this was the problem. Thanks for pointing this out.

Cheers,

Jan

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

Jan Willem de Gee

unread,
Jan 31, 2014, 8:45:46 AM1/31/14
to hddm-...@googlegroups.com
Hey, 

One follow up question:

I'm interested to include inter-trial-variability in drift rate in my model. The most simple way to do this seems:

    model_a = hddm.HDDM(data, include=['sv'])
    model_a.find_starting_values()
    model_a.sample(5000, burn=50, thin=2)

However, this gives me only one 'sv' for the group as a whole, rather than that 'sv' is estimated for individual subjects. I have a minimum of 500 trials per subject. This should be sufficient, correct?

Thanks a lot!

JW

Thomas Wiecki

unread,
Jan 31, 2014, 9:24:45 AM1/31/14
to hddm-...@googlegroups.com
HDDM() does not support individual-subject estimation of sv, although in your case you do seem to have enough data. Is it relevant to your scientific question?

You could use HDDMTransformed() which has it or HDDMTruncated().

Imri Sofer

unread,
Jan 31, 2014, 10:59:09 AM1/31/14
to hddm-...@googlegroups.com
We empirically found that modelling individuals intra-trial variability parameters is not helpful and many times leads to problems in convergence. These parameters don't have a strong effect on the likelihood and can be modeled with only a group variable.

Jan Willem de Gee

unread,
Jan 31, 2014, 1:33:32 PM1/31/14
to hddm-...@googlegroups.com
Hey,

Thanks a lot for your fast responses! 

Imri, I have not looked at convergence yet, but I see your point.

I was asking because estimating individual inter-trial variability in drift rate is in fact relevant to my scientific question. I have reason to believe that some brain measure predicts inter-trial variability in drift rate. Right now I'm doing a median split analysis, and indeed the variability in drift rate is higher in the one group than in the other (as estimated per subject with the HHDMTruncated function -- so that works, thanks!). However, perhaps a nicer analysis would be to run a regression model here.

Cheers,

JW

Thomas Wiecki

unread,
Jan 31, 2014, 2:25:58 PM1/31/14
to hddm-...@googlegroups.com
You can certainly do a (group-only) regression on sv so that's an option.

Jan Willem de Gee

unread,
Feb 26, 2014, 8:09:54 AM2/26/14
to hddm-...@googlegroups.com
Hello,

I have a follow-up question on this topic:

Let me summarise my situation: 

I have run a simple yes-no contrast detection experiment. Per subject I want to obtain: 
- two drift rate estimates: separately for yes- and no-choices
- a starting point estimate

I now estimate the two drift rates with:
hddm.HDDM(RT_data_accuracy, depends_on={'v': 'choice'})

I now estimate the starting point with:
hddm.HDDMStimCoding(RT_data_stimulus, include='z', stim_col='stimulus', split_param='v')

So here is the problem:

In the accuracy coding model, the bias that is present in the subject's responses ("criterion" as per signal detection theory) is bound to affect the "choice effect" in drift rates (yes - no). This is so because this model does not have the parameter starting point (‘z’) on which the response bias could load. Indeed, criterion and drift rate choice effect are highly correlated.

In the stimulus coding model I estimate bias (because here a shift in the starting point towards one of the boundaries actually makes sense), and indeed criterion and starting point are highly correlated.

Obviously this is a problem. What I need is to fit the two drift rates (separately for yes- and no-choices) and the starting point (‘z’) at the same time. I would like to use hddm.HDDMStimCoding for this, but it does not allow the drift rates to vary (they are forced to be of opposite sign). Is there a solution available for this situation?

Many thanks in advance!

Jan Willem 

Thomas Wiecki

unread,
Feb 27, 2014, 2:22:49 PM2/27/14
to hddm-...@googlegroups.com
Hi Jan,

If you understand you correctly, you can just use:

hddm.HDDM(RT_data_accuracy, depends_on={'v': 'choice'}, bias=True)

and use response/stimulus coding to get the model you want.

Thomas

Jan Willem de Gee

unread,
Feb 27, 2014, 4:28:32 PM2/27/14
to hddm-...@googlegroups.com
Hey Thomas,

I want to let 'v' depend on the actual choice, so in case of stimulus coded data ("response" column codes for the actual (yes-no) choice), this becomes: 

hddm.HDDM(data, depends_on={'v': 'response'}, bias=True).

Is it correct that my "response" column codes for the actual choice, and that at the same time I'm letting 'v' depend on this?

Thanks a lot for you help!!

JW

Thomas Wiecki

unread,
Feb 27, 2014, 4:31:52 PM2/27/14
to hddm-...@googlegroups.com
Hi Jan,

I don't think that'll work. Do you have different stimuli in which they respond yes/no? Then I would put that into the depends_on. Presumably both conditions allow for yes/no responses.

Thomas

JW de Gee

unread,
Feb 27, 2014, 4:41:42 PM2/27/14
to hddm-...@googlegroups.com
Hey Thomas,

Sorry to keep confusing you. :-)

The task entails a perceptual decision-making task on which the signal (gabor patch) is present on 50% of the trials; on the other 50% of trials there is only noise. We titrated the contrast of the signal such that subjects perform at about 75% correct. 

Because I think the cortical architecture underlying yes-no decision is asymmetric, I want to fit separate drift rates for the two response alternatives (yes vs no), and I would like to estimate a bias towards the yes or no bound. So I really don't have different conditions.

Well, perhaps the DDM is just not the way to go here...

Thanks again!

JW




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

For more options, visit https://groups.google.com/groups/opt_out.

Thomas Wiecki

unread,
Feb 27, 2014, 4:58:12 PM2/27/14
to hddm-...@googlegroups.com
Maybe conditions is the wrong word, in your case you have different stimuli though, so your model should look like this:

hddm.HDDM(data, depends_on={'v': 'stim'}, bias=True, info=False)

Note that I added info=False above because drift-rate will be negative for one stimulus which is not in line with the informative prior.
Reply all
Reply to author
Forward
0 new messages