DMATintro172014-05-20 10:09:45OlafHauk162013-03-08 10:02:44localhostconverted to 1.6 markup152012-03-08 13:46:53cpc6-cmbg14-2-0-cust458.5-4.cable.virginmedia.com142012-01-24 15:49:22YaaraErez132012-01-24 14:57:23YaaraErez122012-01-24 14:57:01YaaraErez112012-01-21 02:41:00cpc6-cmbg14-2-0-cust458.5-4.cable.virginmedia.com102011-09-20 10:33:17YaaraErez92011-09-20 10:32:38YaaraErez82011-09-13 14:37:50YaaraErez72011-09-13 12:01:53YaaraErez62011-09-13 11:57:00YaaraErez52011-09-13 11:48:07YaaraErez42011-09-13 11:27:05YaaraErez32011-09-13 11:07:34YaaraErez22011-09-13 11:07:04YaaraErez12011-09-13 10:51:38YaaraErezPractical Introduction to Diffusion Modelling using the DMAT toolboxBasicsDMAT is a Matlab toolbox for fitting the Ratcliff Drift Diffusion Model to behavioural data (see DMAT main page, incl. DMAT publication and "primer"). See the following page for a 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. (Currently this only works for matlab version 2009a not 2006b). The format of the input for DMAT should be in a form like this: The first column codes your "conditions", i.e. subsets of your data that 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": 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 The output parameters appear in the following sequence as a row vector: 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) 7: accumulation/drift rate If you have more than one condition, you will get each row of these parameters for each condition. Input Options, Fitting Multiple Models, Inspecting OutputYou can specify a range of different input options, or "models", for DMAT. In order to get the default options, type ddmoptions is a Matlab structure containing input parameters for DMAT. You can change them and then run the model You can specify multiple models ddmoptions(1), ddmoptions(2), etc. These will then be fitted one-by-one, and the outputs will appear in the output structure as ddmoutput(1), ddmoutput(2), etc. Unfortunately, multiestv4 applied to several model invokes the programme "runqueue", which will use the fitted model parameters for one model as starting points for the fit of the next - this may not be what you want. If you want to be sure that models are fitted independently of each other (and the results don't depend on the sequence of your models), then you should fit each model with a separate call to multiestv4(). You can inspect the output of multiestv4 using the function "qtable". In order to compare different models, you can use the function "chi2test". See the appendices of the "primer to DMAT" for examples. Using Design MatricesAssume you want to get different drift rates for each of your subjects, but all other parameters should be kept constant across subjects. By default, all parameters will be kept constant. You can deal with this type of problem very flexibly specifying design matrices for each parameter. Let's assume we only have 3 subjects. In the case where drift rate is constant across subjects (the default), the design matrix is just a vector This means that only one parameter is needed to fit this vector to the data - the drift rate which is common to all subjects. Letting drift rate vary across subjects means that we will obtain 3 separate drift rates, one for each subject. We are therefore fitting a model to the data which consists of three vectors, each representing a single subject. These vectors are the columns of the design matrix which is the identity matrix. You can think of this as a linear regression model y=Db, where y are the data (3 subjects), D is the design matrix (3-by-3 identity matrix above), and b contains the 3 drift rates for each subject that we want to fit. Now assume a slightly more complex example. We still have 3 subjects, but each of them participated in two tasks. We simply vertically concatenate the data matrices (like at the top of this page), so we have 6 conditions - the top 3 belong to task A, and the bottom 3 to task B. Now we want to fit a model where the drift rate varies across subjects, but is the same for conditions A and B within each subject. We now have 6 conditions, i.e. the design matrix should have 6 rows. We want 3 drift rates (one per subject), i.e. the design matrix should have 3 columns. The corresponding design matrix looks like this: If you want to allow for variation of drift rate between conditions A and B within subjects, you can use the following design matrix: This will produce 6 drift rates, one per subject that is the same for A and B, and one per subject that represents the difference in drift rate between conditions A and B. This logic is analogous to the General Linear Model in multiple regression, for example. This is how you specify design matrices in the DMAT options structure: Example ScriptThis example demonstrates how to run a DMAT analysis and change some of the default options, design matrices etc. For more information and further examples, look at the DMAT publication and "primer".