DDM.Individual: Individual subject Drift Diffusion Model (DDM)

Description Usage Arguments Format Fields Methods Examples

Description

Individual subject Drift Diffusion Model (DDM)

Usage

1

Arguments

a

threshold seperation

v

drift rate

t0

non-decision time

z

relative starting point

st0

inter-trial-variability of non-decision time

sv

inter-trial-variability of drift rate

sz

inter-trial-variability of starting point

prior

list containing priors

Format

R6Class object.

Fields

theta.names

a character vector containing the names of the subject-level parameters

theta.init

a function that provides a random initial value for each subject-level parameter

theta.start.point

a numeric vector containing means of start points used to initialize in theta.init

vary.parameter

a logical vector containing parameters to vary

prior

a list containing priors on all parameters

Methods

log.dens.prior(x,hyper)

likelihood of subject-level parameters given group-level parameters

log.dens.like(x,data,par.names)

LBA likelihood function

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
## Not run: 
# DDM model that varies threshold and drift rate across 3 conditions
# Responses of "1" correspond to the lower response boundary and
# resonses of "2" correspond to the upper response boundary.
model = DDM.Individual$new(a=T,v=T,conds=1:3)

# Note, inter-trial-variability components, st0, sv, sz, and
# start point, z, have 3 options: TRUE, FALSE, or 0. When TRUE,
# they will vary across conditions. When FALSE
# they are fit, but not allowed to vary across conditions.
# By default, they are set to 0.
# Note, when z = 0 this indicates no bias (z is internally set to .5).

# st0 is a parameter, other variability parameters are 0
model_st0 = DDM.Individual$new(st0=FALSE)

# sv is allowed to vary over conditions
model_sv = DDM.Individual$new(sv=TRUE)

# by default z is internally set to .5
model_v = DDM.Individual$new(v=TRUE)
# the model above by default sets z to 0, which
# indicates that z will be set to .5 internally.


 # Setting priors:
 prior = list(
 a = c(mu=1,sigma=1),
 v = c(mu=1,sigma=1),
 t0 = c(mu=.3,sigma=.3),
 z = c(mu=.5,sigma=.5),
 sz = c(mu=.2,sigma=.2),
 sv = c(mu=.1,sigma=.1))

 # a and v vary across conditions
 # sz and sv are parameters and do not vary across conditions
 # st0 is 0
 model = DDM.Individual$new(a=TRUE,v=TRUE,sz=FALSE,sv=FALSE)

 # a and v vary across conditions
 # sz and sv are parameters and do not vary across conditions
 # st0 is 0
 # z is a fit parameter but does not vary across conditions
 model = DDM.Individual$new(a=TRUE,v=TRUE,sz=FALSE,sv=FALSE,z=FALSE)

 # Priors can also be changed after creating the model
 model$prior$a = c(mu=2,sigma=2)


## End(Not run)

jeff324/powder documentation built on June 4, 2019, 3:04 a.m.