PPC with HDDMRegressor

293 views
Skip to first unread message

Kwangjun Lee

unread,
Jun 1, 2017, 8:32:40 AM6/1/17
to hddm-users
Dear experts,

Has anyone tried using PPC on HDDM Regressor model?

When I run the code:
ppc_data = hddm.utils.post_pred_gen(m_within_subj, samples=100, append_data=True)

It seems to work fine, but generates a catastrohpic dataframe.
Except for 'wfpt.0' node, all appended data from experimental data are NaNs.
As for the between-subject model, the first level of node represented both condition and subject number.
However, in this case,I have no idea what 'wfpt.0' node represents. The only usable column is the 'rt_sampled' (next to the bold index column).
Also, since the simulated data is not categorized according to conditions, it has no use. It does not even have a 'response_simulated' column.
What seems to be a problem here? Can anyone give me a hint?


wfpt.9923421.985357NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
23431.000795NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
23440.750995NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
23450.693595NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
23462.009395NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
23470.706995NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
23481.291195NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
23490.518995NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN
23501.500395NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaN

Thanks,
Kwangjun

John Clithero

unread,
Jun 13, 2017, 12:44:32 PM6/13/17
to hddm-...@googlegroups.com
Hi Kwangjun,
I was able to replicate your problem. You can always just turn "append_data" off and append the data yourself if you need that. That should work, right?
John

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kwangjun Lee

unread,
Jun 14, 2017, 8:45:37 AM6/14/17
to hddm-users
Hi John,

Thank you so much for replying! 

My data had 2x2 within-subject design, in which there are 4 conditions (A1, A2, B1, B2).
My regressor model estimated 4 different parameters for each of the conditions.

However, the only generated column from the ppc function was 'rt_sampled'. 
I can definitely add 'response_sampled', since it simply differs by positive or negative value.
But, how can I assign a condition to each of the 'rt_sampled' ?

Please let me know if you have any insight :)

Thanks,
Kwangjun
To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+...@googlegroups.com.

John Clithero

unread,
Jun 15, 2017, 1:13:16 PM6/15/17
to hddm-...@googlegroups.com
Hi Kwangjun,
I'd need to know more about your task/design, but if you have four within-subject conditions I think you'd only need three regressors, since you'd need a baseline.
In terms of the PPC, the PPC should generate N sets of data with the same number of trials for each synthetic dataset. Wouldn't that allow you to pair up the simulations with the true data from each condition?
Best wishes,
John

To unsubscribe from this group and stop receiving emails from it, send an email to hddm-users+unsubscribe@googlegroups.com.

Annika Boldt

unread,
Jul 29, 2019, 11:10:01 AM7/29/19
to hddm-users
 Hi,

I hope it is okay if I piggyback this useful thread.

Like Kwangjun, I am experiencing difficulties when using post_pred_gen() for models fit with HDDMRegressor(). Even though I set keep_regressor_trace=True in the model, my 3 conditions are completely ignored. In other words, I get wfpt.1 to wfpt.36 (I have N=36 participants) but not something like (wfpt(Con), 1). Indeed, the row numbers for the resulting data frame are a multiple of my participants, numbers of samples for the PPC and number of trials (not including condition!).

My conditions would be called:
"a_C(stim, Treatment('Rem'))[T.Con]" and
"a_C(stim, Treatment('Rem'))[T.Uad]" plus an intercept "Rem".
I wondered whether those labels might simply be too long, but in that case I would expect an error message instead.

So in response to John's question, I would not be able to pair up the simulations with the true data from each condition. Does anyone have any advice as to how to fix this? Everything works well for between-subjects models.

Best wishes,
Annika

Jae-Young Son

unread,
Aug 6, 2019, 11:59:33 AM8/6/19
to hddm-users
Hi Annika,

I ran into this problem a few years ago, and wrote a little "monkey patch" to address it. Give this a go and see if it helps:

Reply all
Reply to author
Forward
0 new messages