Edited version of original

FRIDAY, AUGUST 31, 2007

EZ2: An extension of the EZ-diffusion model for Response Time and Accuracy

Yesterday, I submitted a paper to the Journal of Mathematical Psychology. In the paper I promised to have an R package available for download from the internet. Here it is. (A version that is installable on Mac OS X with the package installer option 'Local Source Package' is here.) As an alternative to ex-Gauss modeling of response times, this code fits diffusions that model the way information accumulation takes place in the brain (or at least, that's what we think).

For Windows users, you may need to install it with the rcmd command line utility, but you would have to have Perl installed. I'm trying to make it available as a regular zip file soon. (added: here it is.) Meanwhile you might simply try this source file which comes without documentation.

Ahum... the package itself is hardly documented at this point. The documentation essentially boils down to the following:

## create some data (theoretical values, not simulated)
# clearly, you would like to fit real data!
A = seq(.08,.13,len=6)
X2 = data.frame(A=A)
X2$vrt0 = sapply(A, function(a) EZ2.vrt(.1,.05,a))
X2$pe0 = sapply(A, function(a) EZ2.pe(.1,.05,a))
X2$vrt1 = sapply(A, function(a) EZ2.vrt(.2,a-.05,a))
X2$pe1 = sapply(A, function(a) EZ2.pe(.2,a-.05,a))

X2 = as.data.frame(X2)

# now pretend that X2 is the data frame that you have computed from real data

## fit an EZ2 model on each row
# method 1:
EZ2batch(c(v0=.11,v1=.21,z=.05,a=.09),
vrt0 ~ EZ2.vrt(v0,z,a),
pe0 ~ EZ2.pe(v0,z,a),
vrt1 ~ EZ2.vrt(v1,a-z,a),
pe1 ~ EZ2.pe(v1, a-z, a), data=X2)

# method 2 (eventually less typing):
mdl <- list( vrt0 ~ EZ2.vrt(v0,z,a),
pe0 ~ EZ2.pe(v0,z,a),
vrt1 ~ EZ2.vrt(v1,a-z,a),
pe1 ~ EZ2.pe(v1, a-z, a)
)
EZ2batch(c(v0=.11,v1=.21,z=.05,a=.09), mdl, data=X2)

You may also want to try the webapplication. Way more difficult I think, but with a graphical user interface.

These are the downloadable packages

EZ2_1.0.tar.gz (source, Linux)
EZ2_1.0_R_i386-apple-darwin8.10.1.tar.gz (Mac OS X)
EZ2_1.0.zip (Windows)

Installation and or loading the library may result in a warning that the package was built under a different verstion. That can be safely ignored.