Question about specifying hddm.models.HDDMRegressor models

128 views
Skip to first unread message

Yrian Derreumaux

unread,
Nov 5, 2021, 2:16:50 PM11/5/21
to hddm-users
Greetings everyone, 

I have a couple questions regarding whether I am correctly specifying my hddm.models.HDDMRegressor models that I would very much appreciate any feedback on. For context, the results are consistent with my pre-registration but before writing up the paper I want to make sure it's all correct. 

The task: I have data for a task where subjects try and predict on each trial (80 in total) whether an ingroup member (response coded as 1) or outgroup member (response coded as 0) is better as measured by scores (ranging from 0-100) that move across the screen from left to right (ingroup scores are one color and outgroup scores are another color). The scores are pulled from two normal distributions such that on half of the trials (counterbalanced) the ingroup has de facto higher scores (M ingroup = 68, SD = 12; M outgroup = 62, SD = 12), and vice versa. 

Hypotheses: I predicted that participants would be more motivated to respond 1 (ingroup), and would require less and weaker evidence to do so, which is consistent with the behavioral results. Thus, I predicted that the best fitting model would have both a biased starting point in favor of the ingroup, as well as a biased drift rate in favor of the ingroup. To test this, I pre-registered and fit 4 competing models, (1) a model with only biased starting point which can vary between 0-1, and an unbiased drift rate such that the drift rate parameter is symmetric for both ingroup and outgroup, (2) a model with an unbiased starting point (fixed at .5), but a biased drift rate, where the drift rate can vary as a function of the evidence in favor of the correct choice (3) a model with both a biased drift rate and starting point, and (4) a null model that assumes no bias in either. 

Question 1: In the model with a biased starting point, I want to estimate it as a free parameter contained between 0 and 1. Moreover, I wanted to ensure that the bias is z for one condition and 1-z for the other condition, where condition denotes whether the ingroup (1) or outgroup (0) is better on that trial. I tried to do that below, is this correct? 

Link function: 
def z_link_func(x, data=data):
stim = (np.asarray(dmatrix('0 + C(s, [[0], [1]])',
{'s': data.condition.loc[x.index]})))
z_flip = stim - x
z_flip[stim == 0] *= -1
return z_flip

Full model with biased starting point and no bias in drift rate: 
v_reg = {'model': 'v ~ 1 + stim_n + stim_weight', 'link_func': lambda x: x}
z_reg = {'model': 'z ~ 1 + condition', 'link_func': z_link_func}
#where stim_n represented the ratio of scores that are consistent with the correct response, and stim_weight represents the average evidence (mean difference) in favor of the correct response.

Question 2: How would I then specify the model with no bias in starting point (i.e. fixed to .5), right now, the way I do this is to simply remove the condition variable from the z specification (i.e. z_reg = {'model': 'z ~ 1 ', 'link_func': z_link_func}). Is this correct? If not, how might I go about that?

Thanks for taking the time to read this and any insight you may have!



Reply all
Reply to author
Forward
0 new messages