# Practical Introduction to Diffusion Modelling using the DMAT toolbox

DMAT is a Matlab toolbox for fitting the [http://140.254.101.126/coglab/ Ratcliff Drift Diffusion Model] to behavioural data (see [http://ppw.kuleuven.be/okp/software/dmat/ DMAT main page], incl. [http://ppw.kuleuven.be/okp/software/dmat/ DMAT publication] and [http://ppw.kuleuven.be/okp/_pdf/Vandekerckhove2008DMAWM.pdf "primer"]). See the following page for a [http://toolsandtutorials.pbworks.com/w/page/37703696/Commonly-Used-DMAT-Commands#multiestv4 list of DMAT commands].

The following will show you how to get started with the DMAT toolbox.

First things first: In order to use the Matlab toolbox on our linux system, start Matlab and type "dmat" in the command window - this will set the necessary paths etc.

The format of the input for DMAT should be in a form like this:

data = [ ... 1 1 0.5223 1 0 0.6661 2 1 0.9812 2 0 0.4932 3 1 0.4112 3 0 0.8342 ...]

The first column codes your "conditions", i.e. subsets of your data the may be allowed to differ from the rest in some way in the later analysis. This could be separate subjects, or both different experimental conditions and subjects. You can later specify (by means of "design matrices") what you want to keep constant across subjects, across conditions, within subjects etc. (please be patient...).

The second column codes whether a response was "correct" (1) or "incorrect" (0).

The third column contains the response times - make sure they are in seconds (not milliseconds)!

You could already fit the diffusion model using default parameters on these data with the function "multiestv4":

ddmoutput = multiestv4( data );

In this case, you will get one set of fitted parameters for the whole data set, i.e. not for individual condtions.

The result will be in

ddmoutput.Minimum

The output parameters appear in the following sequence:

- 1: Boundary Separation, a
- 2: non-decision time (t_er)
- 3: intertrial standard deviation of drift rate
- 4: starting point, z
- 5: range of z, (s_z, uniform)
- 6: range of t_er (s_t, uniform)