 # Initial values for drift diffusion model with continuous predictor

#1

I have been following Henrik Singmann’s great drift diffusion model tutorial (using brms): http://singmann.org/wiener-model-analysis-with-brms-part-i/

It all works well with categorical predictors (x1:x2:x3, all x’s being categorical), e.g.

``````formula <- bf(RT | dec(Response) ~ 0 + x1:x2:x3 + (0 + x1:x3|p|SubjectID),
bs ~ 0 + x1:x2:x3 + (0 + x1:x3|p|SubjectID),
ndt ~  0 + x1:x2:x3,
bias = 0.5)
``````

However, if I have a numeric predictor (let’s assume linear for now), the model just cannot find valid initial values:

log(0) sampling errors (Log probability evaluates to log(0), i.e. negative infinity.)

I am probably overlooking something basic in how a continuous variable interacts with the x1:x2 notation and failing to account for that when defining initial values.

Here is our reproducible example:

1. A sample dataset: https://www.dropbox.com/s/ji3s4yn9dysda60/exp1_subset.csv?dl=0
The dataset is about a categorical perception task (discriminating between “Sendt” and “Tændt”), where the stimulus is along a graded continuum between the two extremes (Step codes for the position on the continuum). ResponseN is the response, RT_target is the RT. We have 2 additional binary categorical predictors (Language, indicating the native language of the participants; and Bias indicating which perception is supported by the context, a sentence in which the stimulus is situated).

2. A R markdown with the code we used to set up formula, priors and initial values: https://www.dropbox.com/s/rbez946ole3hope/DDM_Step_Singmann.Rmd?dl=0

#2

I don’t have time to look at the exact model and data right now, but possibly the scale of the continuous predictors is too large. Standardizing them might help.

#3

thanks! The scale is 0-1, so that should not be an issue. I think what I’m missing is:
i) if we have a y ~ x1:x2 situation with categorical predictors (2 values for simplicity), we basically need 4 initial values.
ii) if we have y ~ x1:x2 situation with 1 categorical predictor and 1 continuous, I am not sure how the initial values structure should look like.

#4

I often ask myself the same question. You can find out what `model.matrix` actually did by investigating the `\$X_<dpar>` elements of the `make_standata` output.

#5

Thanks! It took a while but by looking at this and trying out a wider range of initial values we managed to make it work.