data coding, model specification, and interpreting the sign/magnitude of model parameters

649 views
Skip to first unread message

Adam Gorka

unread,
May 5, 2021, 4:15:50 PM5/5/21
to hddm-users

Hello everyone,

I am trying to understand how response coding and model specification are related to the interpretation of the sign and magnitude of estimated model parameters. I have consulted the HDDM toolbox but I am still somewhat confused.

My experiment is a Go/No-Go paradigm (90% Go trials, 10% No-Go trials) which occurs during two experimental conditions (A and B).

I want to estimate 4 parameters (drift rate, boundary separation, response bias, and non-decision time) separately for condition A and for condition B. However, because we have very few No-Go trials, I want to estimate 4 model parameters jointly across both Go and No-Go trials.

The model code I used is below (where “stim” denotes the two different experimental conditions):

m = hddm.HDDM(data, p_outlier=.05, include=('z'), depends_on={'a': 'stim', 't': 'stim', 'v': 'stim', 'z': 'stim'})

We coded our data file such that (response = 1 corresponds to the initiation of a button press, and response = 0 corresponds to the absence of a button press) and that (RT = positive values during a correct Go response, RT = -999 during an incorrect Go response, RT = 999 during a correct No-Go response, and RT= negative values during a incorrect No-Go response). Note: correct No-Go trials and incorrect Go trials do not have any associated reaction time because they involve the omission of a response.

Am I correct about the following assumptions:

1)      A more positive drift rate for condition A would mean that information uptake occurs faster during condition A compared to condition B (collapsed across both Go and No-Go trials and across accurate and inaccurate trials).

 

2)      We can apply assumption 1 to interpretations about other model parameters (boundary separation, response bias, and non-decision time).

 

3)      We can use model parameters to estimate a response bias (because we used “response coding” instead of “accuracy coding”).

 

4)      Values above .5 for the response bias parameter in for condition A reflects a bias towards Go responses during condition A, and values above .5 for the response bias parameter in for condition B reflects a bias towards Go responses during condition B. (Note: Go responses are coded as 1, and No-Go responses are coded as 0).

Further, if my assumptions are incorrect:

5)      Given my model, and response coding, what interpretation would be supported by more positive drift rate in condition A compared to condition B?

 

6)      What sort of data coding and model specification would allow for the interpretations discussed in (1-4) above?

 

My apologies in advance if I am misunderstanding anything – or if anything that I wrote is not clear. Any advice or guidance would be appreciated.

Best,

Adam Gorka

Mads Lund Pedersen

unread,
May 18, 2021, 4:49:48 AM5/18/21
to hddm-...@googlegroups.com
Hi Adam, 

If you want to estimate a single drift rate for Go and No-Go, but still estimate bias in favor of Go vs No-Go, it would be better to use HDDMStimcoding. Currently you are estimating a single drift rate, but this model "ignores" the stimulus (go or no-go), so would most likely provide a poor fit to No-Go trials (and to Go, but less so due to the higher rate of Go trials). If you use StimCoding you would still estimate a single drift rate but it would assume that the drift rate is flipped for no-go trials. See tutorial here for more information: http://ski.clps.brown.edu/hddm_docs/howto.html#code-subject-responses

This is the model I would define, where condition defines Go vs No-Go:

m = hddm.HDDMStimCoding(data,stim_col='condition',split_param='v',p_outlier=.05, include=('z'), depends_on={'a': 'stim', 't': 'stim', 'v': 'stim', 'z': 'stim'})

Here the estimated drift rate will likely be negative (reflecting evidence accumulation towards lower bound for no-go conditions). To get the drift rate for Go-conditions you would just need to flip it (0-v).

If you run this model I believe all your assumptions hold. One thing you cannot say with your proposed model, or with StimCoding, is whether differences in drift rate for condition A vs B reflect improved evidence accumulation for Go trials or No-Go trials.

BTW. There's no need to flip the RTs for no-responses. When these are associated with response=0 they will be flipped automatically.


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/hddm-users/23427b0f-0f7b-4703-93ad-ab6bd24f2bbdn%40googlegroups.com.


--
Best, 
Mads

Adam Gorka

unread,
Jan 14, 2022, 4:46:43 PM1/14/22
to hddm-users

Thanks Mads,

I have taken your advice to use HDDMStimcoding. Additionally, I am attempting to determine if the drift rate, boundary separation, and non-decision parameters vary as a function of experimental condition for either A) go trials or B) no-go trials – and whether starting point differs as a function of experimental condition (no distinction between go and no-go trials).

Within the model code below “condition” refers to Go vs No-Go trials, and “stim” denotes the two different experimental conditions. Within the response column: go is coded as 1 and no-go is coded as 0.

m = hddm.HDDMStimCoding(data, stim_col = 'condition', split_param = 'v', bias=True, p_outlier=0.05, include=('z'),  depends_on = {'a':['condition', 'stim'], 't':['condition', 'stim'], 'v':['condition', 'stim'], 'z': 'stim'})

Is the above model code the correct way to ask this question? Within the model output, the drift rates for go and no-go trials are negative for both experimental conditions. Additionally, the starting point parameters is below .5 for both experimental conditions. Is this what you would expect based on the way the model is specified?

Thanks again for any guidance.

Best,

Adam

Mads Lund Pedersen

unread,
Jan 17, 2022, 2:21:52 AM1/17/22
to hddm-...@googlegroups.com
Can you show a few lines of your dataframe, and copy print_stats? 

Best,
Mads L. Pedersen




Adam Gorka

unread,
Jan 18, 2022, 11:10:47 AM1/18/22
to hddm-...@googlegroups.com
Thanks, Mads. I have included the first few lines of my dataframe file and the output from print_stats. Please let me know if there is any issue with the files that I provided or if you would like any additional information.

Best,
Adam

print_stats.csv
DataFrame.png

Chase Mackey

unread,
May 31, 2022, 3:47:09 PM5/31/22
to hddm-users
Hi Mads and Adam, I'm trying something very similar to Adam's project. 

Mads, when you say "This is the model I would define, where condition defines Go vs No-Go" do you mean condition should define the trial type (trials where Go is the correct response, vs trials where the opposite is true)? Or do you mean condition should define whether there was a Go vs. No-Go response from the subject?

Chase

Mads Lund Pedersen

unread,
Jun 3, 2022, 3:25:50 AM6/3/22
to hddm-...@googlegroups.com
Hi Chase,

Your first suggestion is what I meant, that condition defines trial type (go or no-go) while response defines what they responded (1 for go and 0 for no-go).

Best,
Mads L. Pedersen




朱思羽

unread,
Aug 1, 2022, 11:23:04 PM8/1/22
to hddm-users
Hi Mads, Adam, and Chase,
I used a Go/No-GO task (Go: neutral stimuli, No-go: angry & happy stimuli) in my project as well, and now I want to test group differences (my experiment is between-subject design) in four regular model parameters(i.e., avtz). Firstly, I would like to examine four variants of the DDM with different parameter constraints to find the most fitted model. The first model: an unbiased starting point (z = 0.5) and the same absolute value for the drift rate in the Go and No-Go conditions. The second model: an unbiased starting point but allowed the drift rate to vary between the two conditions. The third model: variable starting points across participants and the same absolute value for the drift rate in the two conditions. The fourth model: variable starting points and different drift rates in the two conditions.
But I am not sure how to code my data exactly, and how to define the models I want to compare. I am a beginner of HDDM, your valuable & experienced suggestion will be very appreciated.
Looking forward to your kindly reply!

Best wishes,
Siyu Zhu

Chase Mackey

unread,
Aug 2, 2022, 3:39:00 PM8/2/22
to hddm-...@googlegroups.com
Hi Siyu, I was in the same situation, fortunately de Gee et al. have made their code publicly available, and it's quite good. I adapted it for my purposes (to get model residuals and use that to generate simulated data), but it is similar. I've attached my jupyter files here, and they link to de Gee et al. paper and code. 

Chase

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/Udv7Yt_JnlY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hddm-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hddm-users/244581fa-6591-41c2-aeec-af368e2b2da3n%40googlegroups.com.
Chase_discrimination_ddmCMclean2.ipynb

朱思羽

unread,
Aug 3, 2022, 2:07:11 AM8/3/22
to hddm-users
Hi Chase,
Thanks so much for your share, it's really helpful. And I am not sure how to code the RT for correct No-go trials, should it be set NaN? and for incorrect No-go trials which means subjects made a go response, also for incorrect go trials in which subjects made no response, how to code these 2 kinds of RT? 

Best regards,
Siyu

Chase Mackey

unread,
Aug 4, 2022, 2:09:30 PM8/4/22
to hddm-...@googlegroups.com
All no-go RTs are set to NaN. All go RTs stay as they are.

Reply all
Reply to author
Forward
0 new messages