drt.error: RT distribution of error responses

Description Usage Arguments Details Value Warning Author(s) References Examples

Description

Density and distribution functionof the reaction times of the error responses, and probability of an error, in Ratcliff's diffusion model for two alternative choice RT's.

Usage

1
2
3
drt.error(t, v, a, z, s = 0.1, k = 1:100)
prt.error(t, v, a, z, s = 0.1, k = 1:100)
p.error(v, a, z = a/2, s2 = 0.1^2)

Arguments

t

reaction time

v

drift rate

a

boundary separation

z

starting point of the diffusion

s

diffusion constant

s2

square of diffusion constant

k

terms evaluated in the infinite series (the more, the more accurate)

Details

This function is vectorized in t. For small values of t you need a large range for k.

Value

Density of the error responses.

Warning

Beta version

Author(s)

Raoul Grasman

References

Ratcliff & Tuerlinckx (2002) Estimating parameters of the diffusion model: Approaches to dealing with contaminant reaction times and parameter variability. Psychonomic Bulletin & Review, 9(3), 438–481.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--    or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (t, v, a, z, s = 0.1, k = 1:100)
{
    defect = sapply(t, function(t) pi * s^2 * (exp(-v * z/s^2)/a^2) *
        sum(k * sin(k * pi * z/a) * exp(-(v^2/s^2 + pi^2 * k^2 *
            s^2/a^2) * t/2)))
    defect/p.error(v = v, a = a, z = z, s2 = s^2)
  }

RTmodels documentation built on May 2, 2019, 5:49 p.m.