Negative response latency values for licking in Visual Behavior 2P

In the Visual Behavior 2P dataset, I noticed that some of the values for response latency in the licking behavior (which measures the lick time following an image change) are negative. The magnitudes of the negative values are small. Why are some response latencies negative?

Thank you!

Thanks for the question, this is an important nuance of the data.

The reason the response_time values can be slightly negative is due to a subtlety of how the behavior control software logs information. During the task, the stimulus monitor displays stimulus frames at 60Hz. All behavioral signals (running speed, rewards and licks) are also recorded at this same frame rate. The behavior control software logs the time of each stimulus frame at the time that the command to change the stimulus frame is sent. However, there is a known lag in the time between the command to change the frame and the time the frame is actually displayed. This is called the display lag, and it is a quantity that we measure during the experiment. The values of change_time in the trials table are compensated for the display lag so that the time provided by the SDK reflects the time the stimulus actually changed. However, the display lag does not apply to the lick and reward times - they are recorded at the frame time where they occurred. As a result of this, if a mouse licks right at the change_time on a given trial, the response_latency can be negative because it is the difference between the change_time, with display lag applied, and the lick time, which does not have display lag applied.