Learn R Programming

OPI (version 3.0.4)

opiPresent_for_SimGaussian: opiPresent_for_SimGaussian

Description

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

The FoS has formula $$\mbox{fpr}+(1-\mbox{fpr}-\mbox{fnr})(1-\mbox{pnorm}(x, \mbox{tt}, \mbox{sd})$$ where \(x\) is the stimulus value in dB, and sd is set by opiInitialize and tt, fpr and fnr are parameters.

This is 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.

Examples

Run this code
    # Stimulus is Size III white-on-white as in the HFA
chooseOpi("SimGaussian")
res <- opiInitialize(sd = 1.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))
  warning(paste("opiClose() failed:", res$err))

Run the code above in your browser using DataLab