EZ2-package               package:EZ2               R Documentation

_E_Z_2 _d_i_f_f_u_s_i_o_n _m_o_d_e_l_i_n_g _o_f _R_e_s_p_o_n_s_e _T_i_m_e _a_n_d _A_c_c_u_r_a_c_y

_D_e_s_c_r_i_p_t_i_o_n:

     EZ2 fits a simplified version of the diffusion model for human and
     monkey response times  and accuracy to the means and variances of
     the observables.

_D_e_t_a_i_l_s:


       Package:  EZ2
       Type:     Package
       Version:  1.0
       Date:     2007-08-31
       License:  GPL version 2 (or later)

     You need a data frame containing (at least) the moments (RT means,
     RT variances, and proportions correct) that you would like to
     model.

     Specify for each used moment a formula of the form 'vrt1 ~
     EZ2.vrt(v1, z, a)'.

     Supply the model with the data and a startingpoint for all unknown
     parameters to 'EZ2' or 'EZ2batch' to calculate method of moment
     estimators or least squares estimators of the unknown parameters
     in the model (that is, 'v1', 'z', and 'a' in 'vrt1 ~ EZ2.vrt(v1,
     z, a)').

     Your model can be complex and extensive; for instance 

     'vrt1 ~ EZ2.vrt(v1, z, a) +
     p0*(maxRT-minRT)^2/12+p0*(1-p0)*(EZ2.mrt(v1, z,
     a)-(maxRT+minRT)/2)^2'

     is equaly valid.

_A_u_t_h_o_r(_s):

     Raoul Grasman

     Maintainer: Raoul Grasman <rgrasman@uva.nl>

_R_e_f_e_r_e_n_c_e_s:

     Grasman, Wagenmakers & van der Maas (2007) "EZ2: An extention of
     the EZ-diffusion model for Response Time and Accuracy, _Manuscript
     submitted for publication in J. Math. Psych._

_S_e_e _A_l_s_o:

_E_x_a_m_p_l_e_s:

     ## create some data (theoretical values, not simulated) Needless to say, in reality 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 may 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)

