Hi! It has been a while since this post, but I am now running into a similar problem.
I want to use a Hierarchical Bayesian Reinforcement Learning model to estimate learning rate and inverse temperature for a group of participants’ observed choices under a multi armed bandit task.
In the task, due to how we designed it at first, participants have different length for their trials. In our case, the task block would stop after 7 correct choices in a lapse of 10 trials; different participants would meet this criterion after different number of trials - they would complete a total of two blocks.
For example, participant 1 would have 15 trials for the first block, and then 13 trials for the second block; participant 2 could have 14 in the first and 19 in the second, etc.
I wanted to ask: were you able to make the code work with the other alternative i.e padding your data with something that wouldnt affect the final results? I initially tried padding with a mask and then using a switch statement to not compute the padded elements but I could never make it work ![]()