1- function GAMIT_Retro_Pro_Interaction(targetTime ,nSamples ,lowCognitiveLoad ,highCognitiveLoad ,showGraphics )
1+ function GAMIT_Retro_Pro_Interaction(targetTime ,nSamples ,lowCognitiveLoad ,highCognitiveLoad ,showGraphics , exportRawData )
22%
33% Demonstrate how the retrospective and prospective time estimates are
44% calculated in the GAMIT model.
@@ -7,22 +7,24 @@ function GAMIT_Retro_Pro_Interaction(targetTime,nSamples,lowCognitiveLoad,highCo
77 targetTime = 600 ;
88end
99if nargin < 2
10- nSamples = 50 ;
10+ nSamples = 20 ;
1111end
1212if nargin < 3
1313 lowCognitiveLoad = 0.95 ;
14- highCognitiveLoad = 1.1 ;
14+ highCognitiveLoad = 1.05 ;
1515end
16- if nargin < 4
16+ if nargin < 5
1717 showGraphics = true ;
1818end
19- relativeEstimates = true ;
19+ if nargin < 6
20+ exportRawData = true ;
21+ end
22+ relativeEstimates = true ; % divide through by targetTime
2023
2124% step 1: Get default params & generate a reference curve
2225params = GAMIT_Params();
2326lifetimeCurve = GAMIT_Lifetime(params );
2427
25-
2628testTimes = targetTime * ones(1 ,nSamples );
2729
2830% %% RETROSPECTIVE %%%
@@ -33,6 +35,11 @@ function GAMIT_Retro_Pro_Interaction(targetTime,nSamples,lowCognitiveLoad,highCo
3335prospectiveLow = GAMIT(testTimes ,lowCognitiveLoad ,true ,false ,params ,lifetimeCurve );
3436prospectiveHigh = GAMIT(testTimes ,highCognitiveLoad ,true ,false ,params ,lifetimeCurve );
3537
38+ if exportRawData
39+ t = table(retrospectiveLow ,retrospectiveHigh ,prospectiveLow ,prospectiveHigh );
40+ writetable(t ,' GAMIT_Retro_Pro_Interaction.csv' ,' Delimiter' ,' ,' );
41+ save(' GAMIT_Retro_Pro_Params.mat' ,' params' );
42+ end
3643
3744if showGraphics
3845 % Graphics code shows interaction plot like Block, Hancock & Zakay 2010
@@ -43,10 +50,11 @@ function GAMIT_Retro_Pro_Interaction(targetTime,nSamples,lowCognitiveLoad,highCo
4350 % get retrospective 'coordinates'
4451 yR = [mean(retrospectiveLow ),mean(retrospectiveHigh )];
4552 yeR = [std(retrospectiveLow ),std(retrospectiveHigh )];
53+ yeR = yeR / sqrt(length(retrospectiveLow ));
4654 % get retrospective 'coordinates'
4755 yP = [mean(prospectiveLow ),mean(prospectiveHigh )];
4856 yeP = [std(prospectiveLow ),std(prospectiveHigh )];
49-
57+ yeP = yeP / sqrt(length( prospectiveLow ));
5058 if relativeEstimates
5159 yR = yR / targetTime ;
5260 yeR = yeR / targetTime ;
@@ -56,14 +64,15 @@ function GAMIT_Retro_Pro_Interaction(targetTime,nSamples,lowCognitiveLoad,highCo
5664
5765 hold on ;
5866 % plot lines
59- line(xC , yR ,' Color' ,' b' );
60- % offset this xcoord slightly for ease of view
67+ % offset second set of xcoords slightly for ease of view
6168 xCprime = xC + diff(xC )*.02 ;
62- line(xCprime , yP , ' Color' ,' r ' );
63- legend( ' Retrospective ' ,' Prospective ' );
69+ % line(xC, yR, 'Color','k','LineStyle','--','Marker','o ');
70+ % line(xCprime, yP, 'Color ','k','Marker','o ');
6471 % plot error bars
65- errorbar(xC ,yR ,yeR ,' Color' ,' b' );
66- errorbar(xCprime ,yP ,yeP ,' Color' ,' r' );
72+ errorbar(xC ,yR ,yeR ,' Color' ,' k' ,' LineStyle' ,' --' ,' Marker' ,' o' );
73+ errorbar(xCprime ,yP ,yeP ,' Color' ,' k' ,' Marker' ,' o' );
74+ legend(' Retrospective' ,' Prospective' );
75+
6776 hold off ;
6877 xlabel(' Relative Cognitve Load (Normal load = 1.0)' );
6978 if relativeEstimates
0 commit comments