Models with choice, RT and fixations?

I am working with a model which predicts RT, choice and the path of fixations that subjects make. I am able to run test simulations with

model = bf.simulation.GenerativeModel(prior=prior, simulator=simulator, name=“M”)

if I just use RT and choice, but if I add in the fixations, I get an error in line 660 of simulation.py. Essentially, when running a full experiment with multiple trials, the fixation path matrix has 2 dimensions (100 x nTrials) while the RT and choice are vectors (with length = nTrials) and when simulation.py tries to turn this into a numpy array to save to the sim_data dictionary, an error occurs.

Is there any way that I can specify a 2d matrix as part of the model output, in addition to RT and choice? To clarify, if I run one trial of the model, the output is one reaction time, one choice (1 or 2) and a vector of fixations (e.g. 1, 4 ,4, 5…).
To ensure the output is always the same size, I preallocate a vector of nans with 100 elements (because the model can run for maximum 100 timesteps) and then add the outputted fixation paths to it.

How can I specify to the GenerativeModel or Simulator that the model output is 2 scalars and a vector? Hope this makes sense, thank you!

Hi Jordan, can you rewrite the simulator to simply output a numpy array of shape (n_trials, 102) instead of two vectors and a matrix (i.e., concatenate before returning)?

Hi,

Thank you very much for your reply. Yes, I thought about this but have been working from the LCA example on the Bayes Flow website (I am very new to this). Since in that example, choice and RT have their own columns, I assumed that all the ‘fixations’ in one trial had to be grouped together somehow, but I guess it doesn’t make a difference since it is just the output of the model

Thank you very much, think I was being overly cautious! :slight_smile:

2 Likes