This is a a follow-up for other people who might run into similar issues.
I finally got my models to run. What did the trick was the combination of a few things: I picked better, i.e., much more informative priors, fixed a bug in the update function, found a way around explicit sampling inside the theano.scan loop, and basically deconstructed and then reconstructed the whole model, starting by removing all group-level parameters, the non-centered implementation, throwing out all unnecessary parameters, starting with the simplest model possible, and then working my way up toward more complex models step by step.
What also helped me a lot was writing a simulation script in parallel that created data based on a model identical to the one I was implementing in PyMC3. Simulating data gave me an idea of whether my model was able to capture the interesting effects in my data at all, and fitting my model to simulated data showed me how well my model was recovering parameters in a best-case scenario.
With that, here is some data (30 softmax TS agents):
rewards.csv (64.0 KB)
seasons.csv (26.3 KB)
actions.csv (26.3 KB)
aliens.csv (26.3 KB)
Here are the parameters that were used to simulate the data:
true_params.csv (3.6 KB)
And here is the working model: https://github.com/MariaEckstein/SLCN/blob/master/models/discourse_1735_fixed.ipynb
(For an unknown reason, the jupyter version of the script won’t allow me to define my forget and forget_high parameters based on pm.Beta distributions, so I replaced them with pm.HalfNormal. The commented-out lines are the ones that should be run though.)
I’m still looking for any kind of feedback, so I’d be happy to hear all thoughts and ideas!