HomeOverviewDownload PalamedesSupporting documentationFrequently asked questionsSubmit comments and questionsSubmit a bug reportNews and updates (last update: June 22, 2016Why "Palamedes"?About usOptions besides PalamedesDemos figure galleryModel Comparison ExamplesConfused about Weibull?Failed Fits?

Confused about the Weibull function? Trust us, you are not the only one. A lot of confusion exists regarding the Weibull and related functions (the Gumbel [or log-Weibull], the Quick and the log-Quick functions). Below we hope to clear up some of this confusion.

A standard formulation of the Psychometric Function is given by:


with the Weibull, Gumbel, Quick, and log-Quick functions defined as, respectively:


in which ψ refers to the proportion of correct (or 'yes') responses as a function of the stimulus intensity x. The lower asymptote of psi is given by γ (often referred to as the guess rate), while its upper asymptote is determined by λ (aka the lapse rate ). F in the equation characterizes the sensory mechanism. It has two parameters, α (aka the threshold) and β (aka the slope parameter).

Let's say you perform a 2AFC contrast detection task. You use five stimulus contrasts: 0.01, 0.02, 0.04, 0.08, and 0.16. You present 100 trials at each of the five stimulus contrasts, and the number of trials in which the stimulus was detected are 58, 62, 78, 85 and 95 respectively for the five stimulus contrasts.

If used correctly, the four functions mentioned above (Weibull, Gumbel, Quick, and logQuick) will all lead to the same exact fitted psychometric function. The code below shows how the fitting should proceed for each of the four functions using fixed values for the guess and lase rates. Note that the Weibull and the Quick function expect the stimulus intensities to be passed on a linear scale. An important thing to consider here is that both the Weibull and the Quick evaluate to zero when the stimulus intensity equals zero. In other words, a stimulus intensity of zero should correspond to a complete absence of signal. Moreover, negative values for stimulus intensities are meaningless. The Gumbel and the logQuick, on the other hand, expect stimulus intensities that have been log transformed.

StimLevels = [.01 .02 .04 .08 .16];
OutOfNum = 100*ones(size(StimLevels));
NumPos = [58 62 78 85 95];

paramsFree = [1 1 0 0]; %estimate threshold and slope, fix guess and lapse rate

%search through this grid of parameter values for seed to be used in iterative parameter search
searchGrid.alpha = [.01:.01:.16];
searchGrid.beta = 10.^[-1:.1:1];
searchGrid.gamma = .5;
searchGrid.lambda = 0.01;

%fit Weibull
[paramsFittedW LLW] = PAL_PFML_Fit(StimLevels,NumPos,OutOfNum,searchGrid,paramsFree, @PAL_Weibull)

%fit Quick
[paramsFittedQ LLQ] = PAL_PFML_Fit(StimLevels,NumPos,OutOfNum,searchGrid,paramsFree, @PAL_Quick)

%prepare for Gumbel and logQuick fit
logStimLevels = log10(StimLevels);
searchGridlog = searchGrid;
searchGridlog.alpha = log10(searchGridlog.alpha);

%fit Gumbel
[paramsFittedG LLG] = PAL_PFML_Fit(logStimLevels,NumPos,OutOfNum,searchGridlog,paramsFree, @PAL_Gumbel)

%fit logQuick
[paramsFittedlQ LLlQ] = PAL_PFML_Fit(logStimLevels,NumPos,OutOfNum,searchGridlog,paramsFree, @PAL_logQuick)


The output produced by the above code:

paramsFittedW =   0.0594 0.9380 0.5000 0.0100   %these are α, β, γ, and λ respectively
LLW = -249.8085                                 %log Likelihood

paramsFittedQ =   0.0402 0.9380 0.5000 0.0100
LLQ = -249.8085

paramsFittedG =  -1.2260 0.9380 0.5000 0.0100
LLG = -249.8085

paramsFittedlQ = -1.3957 0.9380 0.5000 0.0100
LLlQ = -249.8085

These four fits all correspond to one and the same psychometric function, namely the green curves in the figures below. Note that the fitted parameter values differ only in the value of the fitted threshold. The value of the threshold estimate for the Gumbel is simply the log-transform of the threshold estimate for the Weibull [log10(0.0594) = -1.226]. Thus the Weibull and the Gumbel are identical except that the Weibull uses a linear scale for contrast whereas the Gumbel uses a logarithmic scale. Similarly, the Quick and the logQuick functions are identical to each other except that the Quick operates on a linear scale but the logQuick operates on a logarithmic scale. The difference between the Weibull and Gumbel on the one hand and the Quick and the logQuick on the other is that, for the former pair, F (in the equation above) evaluates to 0.6321 (1 – e-1) at threshold whereas for the latter pair F evaluates to 0.5.

Note that two PFs of the same kind (i.e., both are Weibull, or both are Gumbel, etc.) that differ in the value for the threshold only are (rigid) translations of each other when plotted on a logarithmic scale, whereas they will differ in their shape when plotted on a linear scale.