Drift Diffusion Model

#1
Hello
I have RT-Accuracy data. I want to estimate the parameters of a drift diffusion model (Ratcliff, 1978). I am assuming that:
v(t)=v(t-1) + v + e(0,s). meaning that at each giving time evidance is accumulated from a normal distribution with expected value v and noise s. I am very very new to R. I installed rtdists. can some one pls explain/refer me as to how I use this package (or any other) to estimate the Drift Diffusion parametes? thanks a lot. Ariel
 

Jake

Cookie Scientist
#2
I haven't used the rtdists package, but I have fit the drift diffusion model (the 4-parameter version, without trial-level variability parameters) in R using the RWiener and bbmle packages. I dug up the code I used to do so and pasted it below, I hope you find it useful.
Code:
library("RWiener")
library("bbmle")

# alpha = boundary separation parameter.
# tau = non-decision time parameter.
# beta = bias parameter.
# delta = drift rate parameter
dat <- rwiener(200, alpha=2, tau=.3, beta=.5, delta=1)
str(dat)
wiener_plot(dat)
par(mar=c(5,4,4,2)+.1)

# fit model
mll <- function(alpha, tau, beta, delta){
  -wiener_likelihood(x=c(alpha, tau, beta, delta), dat=dat)
}
system.time({
  mod <- mle2(mll, start=list(alpha=2, tau=.3, beta=.5, delta=1))
}) # 4.3 seconds


# inspect model
summary(mod)
system.time({
  prof <- profile(mod)
}) # 91 seconds
confint(prof)
plot(prof)