Leader

Saturday 21 March 2015

Race model inequality script; R. Ulrich, J. Miller, H. Schröter, 2007

http://link.springer.com/article/10.3758/BF03193160#
Behavior Research Methods
May 2007, Volume 39, Issue 2, pp 291-302
Testing the race model inequality: An algorithm and computer programs
Rolf Ulrich, Jeff Miller, Hannes Schröter

In psychophysics the race model is used to compare reaction time data from two conditions (X,Y) to a third condition (Z). For example, response times to an auditory task and a visual task, compared to an audiovisual task. It tests if reaction times are faster in the third condition, and if so, they violate the race model and (possibly, depending on the task) represent multisensory integration. The race model inequality, simply, is defined as  P(RTz) < P(RTx) + P(RTy). For a better, and far more detailed explanation and run through - see the above paper!

In this paper, the authors present an algorithm to test the race model inequality and include a set of functions for Matlab that implements the algorithm, although no supplementary .m file appears to be included. The code is in the .pdf, but copying from a .pdf is, as usual, an unnecessarily painful experience.

Here is a slightly modified version of the code included in the paper, it's copied from the .pdf and corrected for various illegal characters, line breaks, etc. etc. Apart from a couple of minor edits, nothing else is changed from the authors original work.

Also included as an example of how to use RaceModel.m is a script (RaceModelTester.m) that generates some reaction time data in the correct form to use with RaceModel.m. The RT data supplied to RaceModel.m should be in three rows, rounded and in milliseconds. There should also be a vector of probabilities, and a true or false to indicate whether to create a plot or not.




Download
RaceModel.zip


Code
% Race model script test

%% Generate data
% 3 columns, in S

% A, V, AV
n=50;
RTs = rand(n,3);
RTs(:,1) = RTs(:,1)+0.5;
RTs(:,2) = RTs(:,2)+0.5;
RTs(:,3) = RTs(:,3);

disp(mean(RTs))

%% Plot generated data

figure
x=(1:n)';
scatter(x,RTs(:,1))
hold on
scatter(x,RTs(:,2))
scatter(x,RTs(:,3))

%% Test race model

% Round and convert RT data to ms
RTs=round(RTs*1000);

% Probabilites to test at
P=0.02:0.02:1;

% Transpose data to rows
X=RTs(:,1)';
Y=RTs(:,2)';
Z=RTs(:,3)';

% Run
figure
[Xp, Yp, Zp, Bp] = RaceModel(X, Y, Z, P, true);



In the plotted figure, P(RTz) < P(RTx) + P(RTy). So, if this data were from a 2-forced alternative choice experiment comparing A, V and AV conditions, where there's a trade off between accuracy and reaction time, multisensory integration appears to have occurred. 

No comments:

AdSense