/usr/share/psychtoolbox-3/PsychTests/FitWeibullTAFCTest.m is in psychtoolbox-3-common 3.0.11.20131230.dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | % FitWeibTAFCTest
%
% Simple test of our ability to fit a Weibull to TAFC data.
% The underlying routine requires the optimization toolbox.
%
% 8/26/94 dhb, ccc Update for new naming conventions.
% Set up some input levels
inputs = [1:1:10]';
[m,n] = size(inputs);
% Cook some data
in_alpha = 6;
in_beta = 3;
nCorrect = round(100*ComputeWeibTAFC(inputs,in_alpha,in_beta));
nError = 100-nCorrect;
% Do the fit
[alpha,beta,thresh] = FitWeibTAFC(inputs,nCorrect,nError);
% Fit with constrained beta (at correct value).
[alpha2,beta2,thresh2] = FitWeibAlphTAFC(inputs,nCorrect,nError,[],in_beta);
% Compute predicted psychometric function
pInputs = 0.1:0.1:10;
predict = ComputeWeibTAFC(pInputs,alpha,beta);
predict2 = ComputeWeibTAFC(pInputs,alpha2,beta2);
% Make a plot
hold off
plot(inputs,nCorrect./(nCorrect+nError),'+');
hold on
plot(pInputs,predict,'r');
plot(pInputs,predict2,'g');
hold off
|