Learn R Programming

ggdmc (version 0.2.5.2)

g_minus: Calculate Drift-diffusion Probability Density

Description

g_minus and g_plus implement A1 to A4 equations in Voss, Rothermund, and Voss (2004). These equations calculate Ratcliff's drift-diffusion model (1978). This source codes are derived from Voss & Voss's fast-dm 30.2 in density.c.

Usage

g_minus(pVec)

g_plus(pVec)

Arguments

pVec

a 9-element parameter (double) vector. The user has to follow the sequence strictly. a, v, zr, d, sz, sv, t0, st0, RT, precision.

Details

Two parallel functions g_minus_parallel and g_plus_parallel, using OpenMP libraries to do numerical integration. They resolve the problem when high precision (> 10) is required.

References

Voss, A., Rothermund, K., & Voss, J. (2004). Interpreting the parameters of the diffusion model: A empirical validation Memory and Cognition, 32(7), 1206--1220. Ratcliff, R (1978). A theory of memory retrieval. Psychology Review, 85(2), 59--108.

Examples

Run this code
# NOT RUN {
pvec1 <- c(a=2, v=2.5, zr=0.5, d=0, sz=0.3, sv=1, t0=0.3, st0=0,
           RT=.550, precision=2.5)
g_minus(pvec1) ## 0.04965882
g_plus(pvec1) ## 2.146265

pvec2 <- c(a=2, v=2.5, zr=0.5, d=.2, sz=0.3, sv=1, t0=0.3, st0=.1,
           RT=.550, precision=2.5)

g_minus(pvec2) ## 0.04194364
g_plus(pvec2)  ## 1.94957

# }

Run the code above in your browser using DataLab