-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSimulation2_urgency_and_race_model.m
128 lines (94 loc) · 2.63 KB
/
Simulation2_urgency_and_race_model.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
%% Simulation2_urgency_and_race_model
%
% This script shows psychophysical kernels under DDM with urgency and under race model
% (corresponds to Fig. 6 in the paper).
%
% The original simulation is time consuming (runs 10^6 trials). As a
% workaround, this script runs a smaller number of trials (10^4) but applys
% a boxcar smoothing (50 ms) to reduce the noise in kernel.
% No smoothing should be applied for the actual simulation.
%
%
% Copyright, Kiani Lab, NYU
%% Parameters
clear;
Niters = 1e4;
smoothing_wid = 50; %ms
%% Run simulation
% DDM with urgency
p.iters = Niters;
p.t_max = 10000;
B = 80;
urg_half = 700;
urg_asymp = 80;
b = (0:p.t_max-1)'*urg_asymp./((0:p.t_max-1)'+urg_half);
p.B = [-B+b(:), B-b(:)]; % Bound
p.non_dec_time = 0;
p.cut_off_RT = 1000;
fprintf('Running DDM with urgency...\n');
urg_sim = DDM_Kernel_Simulation(p);
% Race: input correlation
clear p;
p.iters = Niters;
p.t_max = 20000;
p.B = [-30 30];
p.rB = [Inf -Inf];
p.interaction = 0;
p.rho = -0.2;
p.stim_noise = 1;
p.non_dec_time = 0;
p.cut_off_RT = 1000;
fprintf('Running race model with input correlation 0.2...\n');
input_sim = RACE_Kernel_Simulation(p);
% Race: reflective bound
clear p;
p.iters = Niters;
p.t_max = 10000;
p.B = [-30 30];
p.rB = [10, -10];
p.rho = -1;
p.interaction = 0;
p.non_dec_time = 0;
p.cut_off_RT = 1000;
fprintf('Running race model with reflective bound -10...\n');
reflect_sim = RACE_Kernel_Simulation(p);
% Race: leak and mutual inhibition
clear p;
p.iters = Niters;
p.t_max = 10000;
p.stim_noise = 0;
p.B = [-60 60];
p.B0 = 30;
p.rB = [0 -0];
p.rho = -1;
p.interaction = 0.003;
p.decay = 0.003;
p.booster = p.B0 * (p.interaction + p.decay);
p.non_dec_time = 0;
p.cut_off_RT = 1000;
fprintf('Running race model with leak/mutual inhibition = 1...\n');
lm_sim = RACE_Kernel_Simulation(p);
%% Show figure
figure('color', 'w', 'position', [100 100 400 700]);
xrange = [0 1200];
yrange = 0:1:3;
subplot(4,2,1);
show_kernel(urg_sim, 'stim', smoothing_wid, xrange, yrange);
title('Urgency');
subplot(4,2,2);
show_kernel(urg_sim, 'resp', smoothing_wid, xrange, yrange);
subplot(4,2,3);
show_kernel(input_sim, 'stim', smoothing_wid, xrange, yrange);
title('Race: Input correlation 0.2');
subplot(4,2,4);
show_kernel(input_sim, 'resp', smoothing_wid, xrange, yrange);
subplot(4,2,5);
show_kernel(reflect_sim, 'stim', smoothing_wid, xrange, yrange);
title('Race: Reflective bound -10');
subplot(4,2,6);
show_kernel(reflect_sim, 'resp', smoothing_wid, xrange, yrange);
subplot(4,2,7);
show_kernel(lm_sim, 'stim', smoothing_wid, xrange, yrange);
title('Race: Leak/Inhibition = 1');
subplot(4,2,8);
show_kernel(lm_sim, 'resp', smoothing_wid, xrange, yrange);