Learn R Programming

OPI (version 3.0.4)

opiPresent_for_SimHenson: opiPresent_for_SimHenson

Description

Determine the response to a stimuli by sampling from a cumulative Gaussian Frequency-of-Seeing (FoS) curve (also known as the psychometric function).

For internal use only, use opiPresent().

Value

A list with elements:

  • err NULL if no error, a string message otherwise.

  • seen TRUE or FALSE.

  • time Always NA.

Arguments

stim

A list that contains at least:

  • level which is the stim value in cd/\(\mbox{m}^2\).

fpr

false positive rate for the FoS curve (range 0..1).

fnr

false negative rate for the FoS curve (range 0..1).

tt

mean of the assumed FoS curve in dB.

...

Any other parameters you like, they are ignored.

Details

The FoS formula is $$\mbox{fpr}+(1-\mbox{fpr}-\mbox{fnr})(1-\mbox{pnorm}(x, \mbox{tt}, \mbox{pxVar})$$ where x is the stimulus value in dB, and pxVar is $$\min(\mbox{cap}, e^{A\times\mbox{tt}+B}).$$ The ceiling cap is set with the call to opiInitialize, and A and B are from Table 1 in Henson et al (2000), also set in the call to opiInitialise using the type parameter.

Examples

Run this code
    # Stimulus is Size III white-on-white as in the HFA
chooseOpi("SimHenson")
res <- opiInitialize(type = "C", cap = 6)
if (!is.null(res$err))
  stop(paste("opiInitialize() failed:", res$err))

result <- opiPresent(stim = list(level = dbTocd(20)), tt = 30, fpr = 0.15, fnr = 0.01)
print(paste("Seen:", result$seen, quote = FALSE))

res <- opiClose()
if (!is.null(res$err))
  stop(paste("opiClose() failed:", res$err))

Run the code above in your browser using DataLab