Operating System: macOS v11.6
R version 4.1.2
brms Version: 2.17.0
–
Hi,
I have data coming from an experiment (with humans) in which participants type words in 2 conditions (indicated later on by the mode
variable, recoded with a contrast as 0.5/+0.5). These data are movements times (MTs) in seconds, ranging from close to 0sec to a few seconds.
These movement times are roughly Lognormally distributed when the participant correctly performs the task. But, some participants did not perform the task well in one of these two conditions, and in this (wrongly performed) condition, the movements times are rather Normally distributed.
I would like to build a model to distinguish between these two “classes” of participants:

good participants: participants that perform the task well (i.e., Lognormally distributed MTs in both conditions)

bad participants: participants that do not perform the task well (i.e., Lognormally distributed MTs in one condition, and Normally distributed MTs in the other condition)
My approach has been to use a mixture of two distributions, a Gaussian and a Lognormal one, as follows.
mix < mixture(gaussian, lognormal)
Then to fit the following brms model.
mixture_model < brm(
formula = bf(
movement_time ~ 1 + mode + (1 + mode  participant),
theta2 ~ 1 + mode + (1 + mode  participant)
),
family = mix,
inits = 0,
chains = 4, cores = 4,
warmup = 2000, iter = 5000,
data = df2,
sample_prior = TRUE,
file = "./models/mixture_model.rds"
)
Where the condition (mode
) is allowed to affect both the movement time and the mix proportion theta2
. This seems to “work”, as the average mix proportion (i.e., plogis(theta2_Intercept)
) is quite different between “good” and “bad” participants, but still, I am not sure that this model does exactly what I want. More precisely, I would like to build a mixture model where theta2
(i.e., the probability that a given movement time comes from the Lognormal or the Normal distribution) depends on both the participant and the condition (i.e., mode
). Is the current formulation of the mode achieving that aim?
Here is a clumsy and incomplete (omitting the varying effects and priors) math notation if it can help.
Thank you for your help!
Ladislas