Skip to content

Customization of Psychometric function

Daiichiro Kuroki edited this page Nov 21, 2023 · 5 revisions

I was asked about how to use of the jsQuestPlus library when the intensity of the stimulus varies from 0 to 1. I am not an expert in this area, but the following answer may be helpful.

At first, let's see the definition of the Weibull function used in our default sample code and previous research (Watson, 2017; Watson & Pelli, 1983).

static weibull(stim, threshold, slope, guess, lapse) {
  const tmp = slope * (stim - threshold)/20
  return lapse - (guess + lapse -1)*Math.exp(-Math.pow(10, tmp))
    }

Watson and Pelli (1983) stated that "In the remainder of this paper, we will express intensity in decibels (dB), where 1dB is a factor of 10^(1/20)." (p. 116). Therefore, this function includes power of 10 and divisors of 20.

Now let's plot this function. I will show a R code here for convenience.

weibull_func <- function(stim, threshold, slope, guess, lapse) {
  tmp = slope * (stim - threshold)/20
  return (lapse - (guess + lapse -1)*exp(-10^tmp))
}

# These values should be decided based on previous research or preliminary observations
slope = 3.5 # of the psychometric function
guess = 0.5 # Probability of correct answer by chance
lapse = 0.02 # Probability of mishandling

threshold = -20 # The value that researchers are usually most interested in

x <- seq(-50, 0, by = 1)
y <- weibull_func(x, threshold, slope, guess, lapse)
# Note that this graph shows does not show "correct" but "incorrect" responses.
plot(x, y, xlab = "Stimulus intensity (dB)", ylab = "Probabilities of incorrect responses") 

image

This figure shows that it is reasonable to vary the intensity of the stimulus from -40 to 0 (units in dB). The sample code is also set that way. In other words, it's not reasonable to use this Weibull function if you want to vary the intensity of the stimulus from 0 to 1.

We should define an appropriate psychometric function for our study. If you want to vary the intensity of the stimulus from 0 to 1, it might be better to use a logistic function.

This is a snippet of R code for plotting the logistic function:

# See, https://en.wikipedia.org/wiki/Logistic_function
threshold = 0.5
k = 10
logistic_func <- function(stim, threshold, k) {
  return(1 / (1 + exp(-k * (stim - threshold))))
}
x2 <- seq(0, 1, by = 0.01)
y2 <- logistic_func(x2, threshold, k)
plot(x2, y2, xlab = "Stimulus intensity (arbitrary units)", ylab = "Probabilities of correct responses") 

image

In summary, the most important thing is to assume a suitable model (psychometric function) for your study and estimate its parameters. This model should be based on previous studies or preliminary observations. In the QUEST+ method, not only thresholds but also slope or shape parameters of the function can be estimated.

See a demonstration program.

References

  • Watson, A. B. (2017). QUEST+: A general multidimensional Bayesian adaptive psychometric method. Journal of Vision, 17(3), 1–27. https://doi.org/10.1167/17.3.10
  • Watson, A. B., & Pelli, D. G. (1983). Quest: A Bayesian adaptive psychometric method. Perception & Psychophysics, 33(2), 113–120. https://doi.org/10.3758/BF03202828
Clone this wiki locally