Skip to content

How to Get Thresholds and Slopes

Heiko Schütt edited this page Apr 2, 2017 · 7 revisions

Directly Using the Fitted Parameters

Psignifit directly returns a point estimate and credible intervals for the threshold and width of the psychometric function in result.Fit and result.conf_Intervals. The threshold provided there corresponds to the stimulus level where the unscaled sigmoid reaches the level specified in options.threshPC (default = 0.5). Thus, by default this returns the stimulus level where the psychometric function is half the way between the two asymptotes.

The values returned in the fit structure are directly taken from the Bayesian analysis, are the ones we evaluated in our paper and are also used for plotting. Thus if you do not have specific reasons to use a different definition of the threshold and width or slope, we recommend to use these values for further analysis. If you require other definitions for your analysis the following functions should provide it.

Obtaining Threshold Values

For comparison to other estimation techniques we provide functions to calculate thresholds at any given proportion correct.

The first function is getThreshold(res, pCorrect, unscaled). It calculates the threshold of the function fit in res for pCorrect proportion correct. Unscaled toggles whether you refer to the pCorrect obtained in the experiment (default), or to the percent correct on the original function unscaled by guessing and lapse rate.

For example: This call will find the value at which our function reaches 90% correct:

getThreshold(res,0.9)

A use case for the unscaled scenario might be to find the threshold for the middle of the psychometric function independent of the guessing and lapse rate:

getThreshold(res,0.5,1)

The function also computes worst case credible intervals for the threshold:

[threshold,CI] = getThreshold(res,0.5,1)

The CI array will be [#Values in options.confP]x2 to provide the confidence intervals at all levels provided in options.confP.

Important note: The credible intervals psignifit 4 calculates are based on the proportion correct level specified in your options struct (default is half-way up the sigmoid; information regarding the change of this value can be found here). The credible intervals calculated by this function post Bayesian analysis are conservative: The further you move away from the original threshold, the more conservative they become as we simply and independently assume the worst case for all other parameters. For an accurate analysis first change the threshold to the desired value and then re-run psignifit 4 using this value.

Obtaining Slope Values

We also provide two functions to calculate the slope of the psychometric function from the fits (in proportion correct/stimulus increment). These functions provide no credible intervals.

getSlope(res,stimLevel)

will calculate the slope at a given stimulus level.

For example:

getSlope(res,0.006)

will yield the slope at the stimulus level 0.006.


getSlopePC(res,pCorrect,unscaled)

will calculate the slope at a given percent correct.

For example:

getSlopePC(res,0.6)

will yield the slope at the value where the psychometric function reaches 60% correct.


As for the getThreshold function, the unscaled option allows you to specify the percent correct on the unscaled sigmoid instead.

For example we can calculate the slope at the midpoint of the psychometric function using:

getSlopePC(res,0.5,1)