Hi Stan,
we've been trying to fit a variant of the simple reinforcement learning model on a trial-by-trial basis. The task is a social decision-making paradigm, in which on each trial the subject (1) makes a choice, (2) observes the choices of 4 other players, (3) based on this social information makes a second choice, and (4) the probabilistic outcome is reveals for all players. We encountered some problems and we wish to get some hints /feedback from the mailing list. We run our model on Stan 2.7.0 (rstan) with 16500 samples per chain, 4 chains, 4000 warming-up and 5 steps of thinning, which ends up with 10000 valid samples altogether. Problems are listed below and you might also want to check the model file attached.
(1) Does the low effective sample size (ESS) in the range of 5-50% of the nominal sample size indicate a pathology in the sampling process?
Though nearly all the R-hat of all parameters of interest are below 1.10, quite a few of them have really low ESS due to the fact that they have relatively high auto-correlation. Does increase the length of chains and increase thinning steps (perhaps even thinning=20) make sense to deal with this problem?
(2) Do parameter values near the range boundaries suggest an ill-specified model?
The model uses a learning rate (range 0-1) to weight a reward prediction error, which is then use to update expected values. These are converted into action probabilities using a softmax function parameterized by a temperature parameter (range 0-3). However, the MAP/median of the posterior distribution of learning rate is close to 0 (for another model it's close to 1) and the temperature is also super low (~ 0.3, which indicates random choice). We were wondering if the model is ill-specified but so far we haven't come up with a more sophisticated idea.
(3) Is there a standard way to implement posterior predictive check (PPC) with reinforcement learning models?
We've checked previous entries on the mailing-list about PPC but couldn’t find something that seems to fit. In practice, we want to re-run the model 100 times to simulate data in the generated quantities section to generate simulated choice data. We are planning to divide each simulation of 100 trials into 6-10 bins and then compute the predictive accuracy for, say, let choice for each bin. (Just taking the overall frequency of left choice in all 100 trials or overall number switches as the target measure for a validation is losing too much information as as the overall number of left choices between simulations and data can be identical, yet the model can be wrong on every trial.) Does this binning idea sound like a valid approach to PPC? We would be eager to hear other suggestions from the community.
(4) If you check the attached model code you’l notice that we have 2 sampling statements involving choices in each trial:
statements: choice1 ~ categorical_logit(), and choice2 ~ categorical_logit(). Are both of them used for incrementing the log-probability in Stan?
As the 2nd choice is more important than the 1st one (because the 2nd choice leads to reward/punishment), is there a way to weight the importance of them? say w * sampling1 + (1-w) * sampling2 and then also fit 'w' as a free parameter?
Thanks a lot in advance for giving this some thoughts and we appreciate any input or feedback.
Best,
Lei