On to why the FED3 Bandit task might not produce exactly the probabilities that are set!
In the FED3
Bandit task example, here is the logic that decides if a left poke should be rewarded or not:
The code block is entered following a left poke (line 74), and in line 78 it asks if the result of random(100) returns a value less than the value of prob_left. If prob_left is set to 80, this will evaluate to true when the random(100) function returns any number from 0-79, which will occur 80% of the time. In these cases, FED3 will play a conditioned stimulus and drop a pellet. This is the whole randomizing logic in this Bandit example task, there is nothing else that influences it (the same logic is also repeated for right pokes).
I pulled ~40 files from our lab where we ran this 80-20 bandit task for 72 hours and plotted the average probability of a pellet following an 80% probability (High) poke vs. a 20% probability (Low) poke. It looks as we'd expect from an 80-20 task:
However you can see that individual mice are not always receiving pellets at the 80-20% split. This is due to the variance in random sequences, and the low numbers of trials even when the task was run for 72 hours (we get ~500-800 trials in these sessions). The variance from expected probabilities will likely be larger if you run fewer numbers of trials. It may be possible to force the FED3 to correct for biased sampling, but the example code does not do that.
2) As another possiblity, there may be a semantic issue going on with the expectations of the task and what it means to be an 80-20 bandit. The 80:20 probabilities (or any probabilities you set) are setting the *probability of a reward following each poke*. But this does not mean that 80% of rewards will come from the high-probability pokes. As an example, if a mouse poked Left 100% of the time it would receive a pellet on 80% of these left pokes on aveage, but would receive 100% of its pellets from Left pokes and 0% from Right pokes. So if you asked the question - what percentage of pellets were delivered following Left pokes you won't get 80%. Alivia, is it possible that this explains the discrepancies you are seeing?
Please share more details, data, or ideas. I think this is a really cool and useful task, I want to iron these issues out and make sure everything is working as expected! -Lex