-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGAMIT_Net_Retro_Pro_Interaction.m
More file actions
95 lines (86 loc) · 3.12 KB
/
GAMIT_Net_Retro_Pro_Interaction.m
File metadata and controls
95 lines (86 loc) · 3.12 KB
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
function GAMIT_Net_Retro_Pro_Interaction(targetTime,nTrials,lowCognitiveLoad,highCognitiveLoad,showGraphics,exportRawData,wt1,wt2)
%
% Demonstrate how the retrospective and prospective time estimates are
% calculated in the GAMIT model.
if nargin < 1
targetTime = 650;
end
if nargin<2
nTrials = 20;
end
if nargin<3
lowCognitiveLoad = 0.95;
highCognitiveLoad = 1.05;
end
if nargin<5
showGraphics = true;
end
if nargin<6
exportRawData = true;
end
relativeEstimates = true; % divide through by targetTime
params = GAMIT_Params();
if nargin <8
%step 1: Get default params & generate a reference curve
nCurves = 100;
nSamples = 500;
[wt1, wt2] = GAMIT_Learning(params,nCurves,nSamples);
else
%already generated weights;
end
testTimes = targetTime * ones(1,nTrials);
%%% RETROSPECTIVE %%%
retrospectiveLow = GAMIT_Net(testTimes,lowCognitiveLoad,false,false,params,wt1, wt2);
retrospectiveHigh = GAMIT_Net(testTimes,highCognitiveLoad,false,false,params,wt1, wt2);
%%% PROSPECTIVE %%%
prospectiveLow = GAMIT_Net(testTimes,lowCognitiveLoad,true,false,params,wt1, wt2);
prospectiveHigh = GAMIT_Net(testTimes,highCognitiveLoad,true,false,params,wt1, wt2);
if exportRawData
% t = table(retrospectiveLow,retrospectiveHigh,prospectiveLow,prospectiveHigh);
% writetable(t,'GAMIT_Retro_Pro_Interaction.csv','Delimiter',',');
tdata=[retrospectiveLow,retrospectiveHigh,prospectiveLow,prospectiveHigh];
csvwrite('GAMIT_Retro_Pro_Interaction.csv',tdata );
save('GAMIT_Retro_Pro_Params.mat','params');
end
if showGraphics
%Graphics code shows interaction plot like Block, Hancock & Zakay 2010
figure(1);
clf(1);
%load coordinates
xC = [lowCognitiveLoad, highCognitiveLoad];
%get retrospective 'coordinates'
yR = [mean(retrospectiveLow),mean(retrospectiveHigh)];
yeR = [std(retrospectiveLow),std(retrospectiveHigh)];
yeR = yeR /sqrt(length(retrospectiveLow));
%get retrospective 'coordinates'
yP = [mean(prospectiveLow),mean(prospectiveHigh)];
yeP = [std(prospectiveLow),std(prospectiveHigh)];
yeP = yeP /sqrt(length(prospectiveLow));
if relativeEstimates
yR = yR/targetTime;
yeR = yeR/targetTime;
yP = yP/targetTime;
yeP = yeP/targetTime;
end
hold on;
%plot lines
%offset second set of xcoords slightly for ease of view
xCprime = xC+diff(xC)*.02;
% line(xC, yR,'Color','k','LineStyle','--','Marker','o');
% line(xCprime, yP, 'Color','k','Marker','o');
%plot error bars
errorbar(xC,yR,yeR,'Color','k','LineStyle','--','Marker','o');
errorbar(xCprime,yP,yeP,'Color','k','Marker','o');
legend('Retrospective','Prospective','Location','best');
hold off;
xlabel('Relative Cognitve Load (Normal load = 1.0)');
if relativeEstimates
ylabel('Mean Duration Judgement Ratio');
else
ylabel('Mean Time Estimates');
end
% title('Interaction of retrospective & prospective time estimates with cognitive load');
figureHandle = gcf;
%# make all text in the figure to size 14 and bold
set(findall(figureHandle,'type','text'),'fontSize',14,'fontWeight','bold')
end