test_rbo_questMean.m 1.21 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
pThreshold  = 0.75;
beta        = 3.5;
delta       = 0.01;
gamma       = 0.5;

tGuess      = 4;
tGuessSd    = 3;

q           = QuestCreate(tGuess,tGuessSd,pThreshold,beta,delta,gamma);
q.normalizePdf = 1; 

12
trialsDesired=20;
13 14

wrongRight={'wrong','right'};
15
res         = ones(trialsDesired,1);
16 17 18 19 20 21 22 23

for k=1:trialsDesired
	% Get recommended level.  Choose your favorite algorithm.
%	tTest=QuestQuantile(q);	% Recommended by Pelli (1987), and still our favorite.
 	tTest=QuestMean(q);		% Recommended by King-Smith et al. (1994)
% 	tTest=QuestMode(q);		% Recommended by Watson & Pelli (1983)
	
%   HERE IS MY CODE
24
    %response = round(rand(1,1));
25

26 27
    response  = res(k);
    
28
    q=QuestUpdate(q,tTest,response); % Add the new datum (actual test intensity and observer response) to the database.
29
    disp(num2str(tTest))
30 31 32 33 34 35 36 37 38 39 40 41
end

% Ask Quest for the final estimate of threshold.
t=QuestMean(q);		% Recommended by Pelli (1989) and King-Smith et al. (1994). Still our favorite.
sd=QuestSd(q);
fprintf('Final threshold estimate (meansd) is %.2f  %.2f\n',t,sd);

% Optionally, reanalyze the data with beta as a free parameter.
QuestBetaAnalysis(q); % optional
fprintf('Actual parameters of simulated observer:\n');
fprintf('logC	beta	gamma\n');