Dear HDDM users/team,
I am currently trying to run posterior predictive checks for two regression models. We fitted a model for a prosocial decision-making task, but due to a mixed design, separately for a sample of younger adults and older adults.
This means we run the same model twice, one including younger adults only, and one including older adults only.
Now I want to run the PPC, which is no problem for the younger-adults-model.
But every time I want to run the PPC for the older-adults model (exact same code, same model, only different data) I get the following error message:
ppc_data = hddm.utils.post_pred_gen(m12OA_reg)
Traceback (most recent call last):
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/indexing.py", line 1469, in _get_list_axis
return self.obj._take_with_is_copy(key, axis=axis)
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/generic.py", line 3363, in _take_with_is_copy
result = self.take(indices=indices, axis=axis)
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/generic.py", line 3351, in take
indices, axis=self._get_block_manager_axis(axis), verify=True
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/internals/managers.py", line 1449, in take
indexer = maybe_convert_indices(indexer, n)
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/indexers.py", line 250, in maybe_convert_indices
raise IndexError("indices are out-of-bounds")
IndexError: indices are out-of-bounds
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<ipython-input-6-a454363c6e94>", line 1, in <module>
ppc_data = hddm.utils.post_pred_gen(m12OA_reg)
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/kabuki/analyze.py", line 328, in post_pred_gen
for name, data in iter_data:
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/kabuki/analyze.py", line 324, in <genexpr>
iter_data = ((name, model.data.iloc[obs['node'].value.index]) for name, obs in model.iter_observeds())
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/indexing.py", line 879, in __getitem__
return self._getitem_axis(maybe_callable, axis=axis)
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/indexing.py", line 1487, in _getitem_axis
return self._get_list_axis(key, axis=axis)
File "/Users/lena/opt/anaconda3/envs/py36/lib/python3.6/site-packages/pandas/core/indexing.py", line 1472, in _get_list_axis
raise IndexError("positional indexers are out-of-bounds") from err
IndexError: positional indexers are out-of-bounds
For your information, I am working on a Mac Book, using Anconda and Spyder (5.0.5), with Python 3.6.13 and HDDM 0.8.0. However, a colleague also tried to run the PPC on a windows PC (Spyder 3.8, HDDM 0.8.0), getting the same error message.
I’ll send you a google drive link including the m12OA_reg traces, to replicate the error message: https://drive.google.com/file/d/1JXBCBsVlfnAz7FqqW69Rvv49I0XKmxuI/view?usp=sharing
I would really appreciate your help, as we were not able to solve the problem!
Best wishes and thanks in advance!
Lena
--
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/hNBakvESD_8/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/df7cc694-f286-45a1-ae21-90cd89436538n%40googlegroups.com.