multiple drift rates for a single trial with variability in the changepoints of visual evidence across trials #125
|
hi, I am modeling data from an RT task that stochastically manipulates the strength of visual evidence multiple times within the same trial, with changepoints that vary from trial-to-trial. However, unlike the changing signal strength example in the cookbook, I do not wish to assume a single drift value for the entire trial. Instead, I would like to estimate a unique drift rate for each trial epoch (drift1: t0-t1; drift2: t1-t2; drift3: t2-t3; drift4: t3-t4. During t0-t1 and t2-t3, visual evidence coherence is 0; during t1-t2 and t3-t4, it is a fixed value. The arousal example demonstrates how to specify a unique moment-to-moment drift rate, but I do not have a separate measurement that I want to scale the drift rate by. My main analytic goal is determining whether the value of drift3 differs between experimental conditions. In this case, my conditions correspond to a 50% prior probability and an 80% prior probability; H0 says drift3 is not different between conditions, H1 says that drift3 is greater for 80% trials than 50% trials. How do you suggest dealing with the fact that not all trials contain all timebins? If a subject responds in the window t0-t1, for instance, then drifts2-4 should simply be NA. This problem is moot for both of the examples linked above because the model is tasked with fitting a single value that is scaled by different conditions/measurements, and thus the trials where behavior does reach later timepoints simply don't contribute to the estimate. One option is to define the drift as 0 on those trials, but I am not sure how that would impact the final estimated values -- I would be grateful if you could help me get an intuition on this. Another option I considered is fitting only a subset of the data corresponding to trials that made it to the fourth timebin. But this would only be using a fraction of my overall data and limits the scope of my results. Finally, I am working on a different specification that is more similar to the examples in the cookbook, in that I task the model with returning two different weights (one on sensory evidence and one on the prior). During the epochs corresponding to drift1 and drift3, the function returns only memoryWeight*memoryEvidence (since visionEvidence=0), and during the epochs corresponding to drift2 and drift4, the function returns memoryWeight*memoryEvidence + visionWeight*visionEvidence. The main drawback with this approach is that it does not allow me to test my initial hypothesis about the drift rate during the time period t2-t3 -- it would return a single value of memoryWeight and visionWeight. Thank you in advance for the help! Here is example code:
When I fit this model to data from a single participant in the 80% prior condition only, I got the following parameter values: {'drift': {'noise1_drift': Fitted(0.3144842593379107, minval=0.01, maxval=1), |
Replies: 2 comments
|
On your question about dealing with the fact that not all trials contain all timebins, it really depends on how you wan to model it. There isn't really a good way to do this, as you can see in the arousal example you cited. I can help with technical questions but this, and your question about fitting only a subset of the trials, are scientific questions that are best discussed with collaborators. Your example code will not work because of the "else: return 0" statements scattered throughout. But if you get rid of these you should be good and this code should do what you intend. Your parameter for signal2_drift is getting pretty close to your maximum allowed value of 1, you might want to allow higher values. You also might want to allow non-decision time to be fit. (Right now you are fixing to the value of 0.2.) Your model diagnostic plot doesn't look too bad to my eyes. If you plot it with a larger value for the "data_dt" argument (passed to plot_fit_diagnostics or model_gui), it will smooth it out a bit and visually look a bit nicer. |
|
thank you so much! |

On your question about dealing with the fact that not all trials contain all timebins, it really depends on how you wan to model it. There isn't really a good way to do this, as you can see in the arousal example you cited. I can help with technical questions but this, and your question about fitting only a subset of the trials, are scientific questions that are best discussed with collaborators.
Your example code will not work because of the "else: return 0" statements scattered throughout. But if you get rid of these you should be good and this code should do what you intend.
Your parameter for signal2_drift is getting pretty close to your maximum allowed value of 1, you might want to a…