-
Hello everyone, I have an array of 1000 data, but for some reason, I can only access 39.9% of these data. This issue arises in a reaction time game that I am coding. In the game, a user must click a button before an image disappears from their screen. The game is rigged so that the user maintains a 20% success rate across trials. I accomplish this rigging using ex-Gaussian data. Specifically, I have an array of 1000 ex-Gaussian data, and at the start of each trial, I choose a number from the bottom 20% of these data to represent how long the image will last on the user's screen. The result is that the user will have only a 20% chance of responding to the image quickly enough. The goal of this process is to force the user to have a 20% success rate across trials. If the user's ongoing success rate happens to be greater than 20%, I decrease the likelihood of succeeding in each trial by 5% until the success rate is 0.2. Similarly, if the user's ongoing success rate is less than 20%, I increase the likelihood of succeeding in a trial by 5% until the success rate is 0.2. The problem is that I cannot increase the success likelihood past 0.399. It should be able to go all the way up to 1.0, in which case I would be sampling from all of my ex-Gaussian data. However, if I allow my game to run without touching the button, the success likelihood increases in increments of 0.5 - as it should - until it reaches 0.399. Then, it stops increasing. I do not know why that is happening, or why the success likelihood is even able to be 0.399 when it is supposed to increase in increments of 0.5.
Does anyone know why the access to my array is restricted? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Update: I solved this issue by changing my code to this: |
Beta Was this translation helpful? Give feedback.
Update: I solved this issue by changing my code to this:
let cutoff = Math.round(1000 * success_likelihood)
StackOverflow discussion