syntax questions

73 views
Skip to first unread message

Inge Leunissen

unread,
Sep 12, 2012, 6:48:57 AM9/12/12
to hddm-...@googlegroups.com
Hi, 

First of all congratulations on the update, everything works smoothly so far! 

I've got 2 naive syntax questions. 

1) I've ran a group model with a condition effect on 'a' and I'm trying to compute the difference between conditions by means of the group_cond_diff function I found in kabuki.analyze

>>> group_cond_diff(model,'a','repeat','switch')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\kabuki\analyze.py", line 215, in group_con
d_diff
    node_dict = hm.params_include[name].subj_nodes
AttributeError: 'HDDM' object has no attribute 'params_include'

I assume that I did not enter the node name correctly but I've tried a number of possibilities and it keeps giving the same error message. Can anyone help me out with the correct syntax? 
Moreover, I've also got a model which contains a group*condition interaction, any tips on how I can adjust the script such that it loops over subjects and groups?

2) I tested convergenge by means of the posterior plots and geweke. I would however like to run the gelman_rubin. Since I've got a group model the MAP method cannot be used and it is suggested to use the subj_by_subj_map_init. I cannot seem to find this function anywere, how should it be called? 

Thanks a lot! 

Inge 

Inge Leunissen

unread,
Sep 12, 2012, 6:57:30 AM9/12/12
to hddm-...@googlegroups.com
Sorry, I've been reading some of the previous post and just to make things clear: the model is hierarchical, and not a 'flat' group model 

Thomas Wiecki

unread,
Sep 12, 2012, 7:05:02 AM9/12/12
to hddm-...@googlegroups.com
Hi Inge,

On Wed, Sep 12, 2012 at 6:48 AM, Inge Leunissen <ingele...@gmail.com> wrote:
Hi, 

First of all congratulations on the update, everything works smoothly so far! 

I've got 2 naive syntax questions. 

1) I've ran a group model with a condition effect on 'a' and I'm trying to compute the difference between conditions by means of the group_cond_diff function I found in kabuki.analyze

>>> group_cond_diff(model,'a','repeat','switch')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python27\lib\site-packages\kabuki\analyze.py", line 215, in group_con
d_diff
    node_dict = hm.params_include[name].subj_nodes
AttributeError: 'HDDM' object has no attribute 'params_include'

I assume that I did not enter the node name correctly but I've tried a number of possibilities and it keeps giving the same error message. Can anyone help me out with the correct syntax? 

Unfortunately it seems this function is deprecated (we missed that somehow). However, it is quite easy to compute the difference between two (group) nodes manually:
diff_trace = model.nodes_db['a_cond1'].node.trace() - model.nodes_db['a_cond2'].node.trace()
diff_mean = numpy.mean(diff_trace)
p_sig = numpy.mean(diff_trace < 0) # check for prob mass < 0

Moreover, I've also got a model which contains a group*condition interaction, any tips on how I can adjust the script such that it loops over subjects and groups?

Checking if the group mean differs might be good enough. But in general you can access each node individually via the nodes_db.

2) I tested convergenge by means of the posterior plots and geweke. I would however like to run the gelman_rubin. Since I've got a group model the MAP method cannot be used and it is suggested to use the subj_by_subj_map_init. I cannot seem to find this function anywere, how should it be called? 

Not sure why you need the MAP for gelman_rubin?

subj_by_subj_map_init has been changed to: model.approximate_map() 

Thomas

Thanks a lot! 

Inge 


Reply all
Reply to author
Forward
0 new messages