opiPresent_for_SimHensonRT {OPI} | R Documentation |
opiPresent_for_SimHensonRT
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()
.
Arguments
stim |
A list that contains at least:
|
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. |
dist |
The distance of the stimulus level from |
... |
Any other parameters you like, they are ignored. |
Details
As the response time returned for a false positive is determined separately from a positive response, we first check for a false response. If there is no false response, we use the FoS formula
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.
Thus, this function is the same as for SimHenson
, but
reaction times are determined by sampling from rtData
as passed to
opiInitialize
. The dist
parameter is the distance of the
stimulus level from the true threshold, and should be in the same units as
the Dist
column of rtData
. The default is just the straight
difference between the stimulus level and the true threshold, but you might
want it scaled somehow to match rtData
.
Value
A list with elements:
-
err
NULL
if no error, a string message otherwise. -
seen
TRUE
orFALSE
. -
time
The response time.
Examples
# Stimulus is Size III white-on-white as in the HFA
chooseOpi("SimHensonRt")
data(RtSigmaUnits)
res <- opiInitialize(type = "C", cap = 6, rtData = RtSigmaUnits)
if (!is.null(res$err))
stop(paste("opiInitialize() failed:", res$err))
dist <- (10 - 30) / min(exp(-0.098 * 30 + 3.62), 6)
result <- opiPresent(stim = list(level = dbTocd(20)), tt = 30, fpr = 0.15, fnr = 0.01, dist=dist)
print(result, quote = FALSE)
res <- opiClose()
if (!is.null(res$err))
stop(paste("opiClose() failed:", res$err))
if (!is.null(opiClose()))
warning("opiClose() failed")