Modeling bimodal duration data with categorical predictors with brms

Hello!

I have collected some eye-tracking data within a three-factorial experiment design. My response variable is the start time of looking at some object (called as Gaze Onset) during the task of picture description. My Gaze Onsets follow a bimodal distribution for which I actually have found an explanatory variable (Gaze Label, the name of the object my participants look at the picture, see the Figure).

My problem is that when I specify this explanatory variable as a co-variate in my Bayesian regression model, the sampler still does not detect the two modes of the response variable (see the posterior predictive check below).

Looking into different examples of models of bimodal distributions (e.g. https://psyarxiv.com/cdxv3/), the inclusion of an explanatory variable of the two modes should take care of the bimodal distribution in the sampler. I am new to Bayesian data analysis. Therefore, I am still modelling my data with unrestricted priors. Here’s the specification of my model.

myBrmsModel = brm(GazeOnset ~ identity*doubleActor*load +
                    GazeLabel +
                    (1+identity*doubleActor*load|participantID) +
                    (1+identity*doubleActor*load|item) +
                    (1|trialIndex),
                  family = shifted_lognormal(),
                  data = test)

I have already implemented the shifted_lognormal family suggested in this post: Regression Models for Duration Data. The mixture family did not work for my data as the convergence got really bad. Would you have any more ideas how could I capture the two modes of my response variable, please? Since I’m not a programming queen, I would appreciate the bits and pieces of concrete code.

1 Like

Hi guys,

Meanwhile I took the courage and set some uninformative or regularizing priors and switched to the mixture modelling:

mix <- mixture(exgaussian, exgaussian)
prior <- c(
  prior(normal(0, 1000), Intercept, dpar = mu1),
  prior(normal(1000, 1000), Intercept, dpar = mu2))

and I defined a simpler model with my controlled factors only:

myBrmsModel <- brm(bf(GazeOnset ~ identity*doubleActor*load),
                   data = test,
                   family = mix,
                   prior = prior,
                   control = list(adapt_delta = 0.99),
                   init = 0,
                   iter = 5000)

With these changes, I indeed got brms to sample from a bimodal posterior:

But now I have another burning question. Could you help me to add in the random effects structure together with the priors? I have uploaded the subset of my data this time as well.

The desired random effects structure:

(1+identity*doubleActor*load|participantID) +
                        (1+identity*doubleActor*load|item)+
                         (1|trialIndex)

The data:
22-07-26_gazeOnsetsSubset.txt (60.8 KB)

I’m indeed a newbie here and would be extremely thankful for your help!

1 Like