Dear all,
we conducted a study assessing sequential choice biases. Currently we are fitting 3 stimulus coded models with either the drift rate v or the starting point z or both dependent on the last trial. The model fitting works well, but when trying to simulate data from the posterior parameters using hddm.utils.post_pred_gen() we get an error message. I am using hddm version 0.8.0 and kabuki version 0.6.5. My code and error message from the model fitting will be appended at the bottom. If you need any more info, please let me know.
Thank you!
Samuel
models = []
for i in range(2):
HDDM3 = hddm.HDDMStimCoding(data, include = ['a', 't', 'z', 'v', 'sz', 'st', 'sv'], stim_col='stim_type', depends_on={'v': 'response_lagged', 'z': 'response_lagged'}, p_outlier = 0.05, bias = True)
HDDM3.find_starting_values()
HDDM3.sample(10000, burn=5000, dbname = 'traces3.db', db = 'pickle')
models.append(HDDM3)
np.max(list(gelman_rubin(models).values()))
HDDM3_concat = kabuki.utils.concat_models(models)
ppc_data = hddm.utils.post_pred_gen(HDDM3_concat)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_9192\1528903545.py in <module>
----> 1 ppc_data = hddm.utils.post_pred_gen(HDDM3_concat)
~\anaconda3\envs\desperation\lib\site-packages\kabuki\analyze.py in post_pred_gen(model, groupby, samples, append_data, add_model_parameters, progress_bar)
378 data=data,
379 append_data=append_data,
--> 380 add_model_parameters=add_model_parameters,
381 )
382 results[new_name] = pd.concat(
~\anaconda3\envs\desperation\lib\site-packages\kabuki\analyze.py in _post_pred_generate(bottom_node, samples, data, append_data, add_model_parameters)
295 _parents_to_random_posterior_sample(bottom_node)
296 # Generate data from bottom node
--> 297 sampled_data = bottom_node.random(add_model_parameters=add_model_parameters)
298 if append_data and data is not None:
299 sampled_data = sampled_data.join(data.reset_index(), lsuffix="_sampled")
TypeError: random() got an unexpected keyword argument 'add_model_parameters'