Description Usage Arguments Format Fields Methods Examples
Individual subject Drift Diffusion Model (DDM)
1 |
a |
threshold seperation |
v |
drift rate |
t0 |
non-decision time |
z |
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 |
R6Class
object.
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
log.dens.prior(x,hyper)
likelihood of subject-level parameters given group-level parameters
log.dens.like(x,data,par.names)
LBA likelihood function
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 | ## Not run:
# DDM model that varies threshold and drift rate across 3 conditions
model = DDM.Individual$new(a=T,v=T,conds=1:3)
# Note, inter-trial-variability components, st0, sv, and sz
# 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.
# st0 is a parameter, other variability parameters are 0
model_st0 = DDM$new(st0=FALSE)
# sv is allowed to vary over conditions
model_sv = DDM$new(sv=TRUE)
# Setting priors:
prior = list(
a = list(mu = c(mu = 1, sigma = 1),
sigma = c(mu = 1, sigma = 1)),
v = list(mu = c(mu = 1, sigma = 1),
sigma = c(mu = 1, sigma = 1)),
t0 = list(
mu = c(mu = .3, sigma = .3),
sigma = c(mu = .3, sigma = .3)),
st0 = list(
mu = c(mu = .1, sigma = .1),
sigma = c(mu = .1, sigma = .1)))
# a and v vary across conditions
# sz and sv are 0
# t0 and st0 are parameters that do not vary across conditions
model = DDM$new(a=TRUE,v=TRUE,prior=prior)
# Priors can also be changed after creating the model
model$prior$a$mu = c(mu=2,sigma=2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.