b'% Created by hacking a copy of QuestDemo.m, in order to'
b'% do some simulations for Beau Watson.'
b'% 128 repetitions of each condition'
b'% Quest assumes LogWeibull psychometric function with parameters:'
b'% beta = {1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5} (in separate conditions)'
b'% sample range = {-30,30} dB'
b'% sample step size 0.5 dB'
b'% Prior is always Gaussian, sd=12 dB, centered on guess.'
b'% Initial guess drawn from Normal distribution with mean 0 and sd=6 dB.'
b'% Quest uses mode of posterior density.'
b'% Simulated observer has LogWeibull psychometric function with parameters:'
b'% {beta=3.5,gamma=.03,delta=.01}'
b'% By commenting and uncommenting five lines below, you can use'
b'% this file to implement three QUEST-related procedures for measuring'
b'% QuestMode: In the original algorithm of Watson & Pelli (1983)'
b'% each trial and the final estimate are at the MODE of the posterior pdf.'
b'% QuestMean: In the improved algorithm of King-Smith et al. (1994).'
b'% each trial and the final estimate are at the MEAN of the posterior pdf.'
b'% QuestQuantile & QuestMean: In the ideal algorithm of Pelli (1987)'
b'% each trial is at the best QUANTILE, and the final estimate is at '
b'% the MEAN of the posterior pdf.'
b'% King-Smith, P. E., Grigsby, S. S., Vingrys, A. J., Benes, S. C., and Supowit, A.'
b'% (1994) Efficient and unbiased modifications of the QUEST threshold method: theory, '
b'% simulations, experimental evaluation and practical implementation. '
b'% Vision Res, 34 (7), 885-912.'
b'% Pelli, D. G. (1987) The ideal psychometric procedure. Investigative Ophthalmology '
b'% & Visual Science, 28 (Suppl), 366.'
b'% Watson, A. B. and Pelli, D. G. (1983) QUEST: a Bayesian adaptive psychometric '
b'% method. Percept Psychophys, 33 (2), 113-20.'
b'% Copyright (c) 1996-1997 Denis G. Pelli'
b'% 6/24/97 dgp\twrote it, based on QuestDemo.m'
b"fprintf('beta\tmean\tsd\t\treps\\n')"
b'for beta = [1.5:.5:5.5]'
b'\t\ttGuess=randn*6/20;'
b'\t\tpThreshold=0.6370;'
b"\t\twrongRight=str2mat('wrong','right');"
b'\t\tq=QuestCreate(tGuess,tGuessSd,pThreshold,beta,delta,gamma,grain,range);'
b'\t\tqObserver=QuestCreate(tActual,tGuessSd,pThreshold,3.5,delta,gamma,grain,range);'
b"\t\t%fprintf('Quest estimate of thresh after initialization is %g\\n',QuestMean(q));"
b"\t\t%fprintf('Initial value was %g\\n',tGuess);"
b"\t\t%fprintf('Quest estimate of sd after initialization is %g\\n',QuestSd(q));"
b"\t\t%fprintf('Initial value was %g\\n',tGuessSd);"
b'\t\tfor k=1:trialsDesired'
b'\t\t\ttTest=QuestMode(q);\t% 0.03 s'
b'\t\t \tresponse=QuestSimulate(qObserver,tTest,tActual); % 0.10 s'
b'\t\t\tq=QuestUpdate(q,tTest,response); % 0.10 s'
b"\t\t%fprintf('%4.1f\\t%+6.3f\\n',beta,t);"
b"\tfprintf('%4.1f\\t%+6.3f\\t%5.3f\\t%d\\n',beta,mean(estimate),std(estimate),length(estimate));"
b'\\ No newline at end of file'
3
% Created by hacking a copy of QuestDemo.m, in order to
4
% do some simulations for Beau Watson.
6
% 128 repetitions of each condition
7
% Quest assumes LogWeibull psychometric function with parameters:
8
% beta = {1.5, 2., 2.5, 3., 3.5, 4., 4.5, 5., 5.5} (in separate conditions)
11
% sample range = {-30,30} dB
12
% sample step size 0.5 dB
13
% Prior is always Gaussian, sd=12 dB, centered on guess.
14
% Initial guess drawn from Normal distribution with mean 0 and sd=6 dB.
15
% Quest uses mode of posterior density.
16
% Simulated observer has LogWeibull psychometric function with parameters:
17
% {beta=3.5,gamma=.03,delta=.01}
20
% By commenting and uncommenting five lines below, you can use
21
% this file to implement three QUEST-related procedures for measuring
24
% QuestMode: In the original algorithm of Watson & Pelli (1983)
25
% each trial and the final estimate are at the MODE of the posterior pdf.
27
% QuestMean: In the improved algorithm of King-Smith et al. (1994).
28
% each trial and the final estimate are at the MEAN of the posterior pdf.
30
% QuestQuantile & QuestMean: In the ideal algorithm of Pelli (1987)
31
% each trial is at the best QUANTILE, and the final estimate is at
32
% the MEAN of the posterior pdf.
34
% King-Smith, P. E., Grigsby, S. S., Vingrys, A. J., Benes, S. C., and Supowit, A.
35
% (1994) Efficient and unbiased modifications of the QUEST threshold method: theory,
36
% simulations, experimental evaluation and practical implementation.
37
% Vision Res, 34 (7), 885-912.
39
% Pelli, D. G. (1987) The ideal psychometric procedure. Investigative Ophthalmology
40
% & Visual Science, 28 (Suppl), 366.
42
% Watson, A. B. and Pelli, D. G. (1983) QUEST: a Bayesian adaptive psychometric
43
% method. Percept Psychophys, 33 (2), 113-20.
45
% Copyright (c) 1996-1997 Denis G. Pelli
47
% 6/24/97 dgp wrote it, based on QuestDemo.m
49
fprintf('beta mean sd reps\n')
51
for beta = [1.5:.5:5.5]
63
wrongRight=char('wrong','right');
64
q=QuestCreate(tGuess,tGuessSd,pThreshold,beta,delta,gamma,grain,range);
65
qObserver=QuestCreate(tActual,tGuessSd,pThreshold,3.5,delta,gamma,grain,range);
66
%fprintf('Quest estimate of thresh after initialization is %g\n',QuestMean(q));
67
%fprintf('Initial value was %g\n',tGuess);
68
%fprintf('Quest estimate of sd after initialization is %g\n',QuestSd(q));
69
%fprintf('Initial value was %g\n',tGuessSd);
72
tTest=QuestMode(q); % 0.03 s
73
response=QuestSimulate(qObserver,tTest,tActual); % 0.10 s
74
q=QuestUpdate(q,tTest,response); % 0.10 s
77
%fprintf('%4.1f\t%+6.3f\n',beta,t);
80
fprintf('%4.1f\t%+6.3f\t%5.3f\t%d\n',beta,mean(estimate),std(estimate),length(estimate));