paul-buerkner / brms

brms R package for Bayesian generalized multivariate non-linear multilevel models using Stan
https://paul-buerkner.github.io/brms/
GNU General Public License v2.0
1.26k stars 177 forks source link

Predicting all mixture proportions in mixture families, similar to refcat = NA for ordinal or multinomial models. #1450

Open GidonFrischkorn opened 1 year ago

GidonFrischkorn commented 1 year ago

Hi Paul, I am currently working on implementing cognitive measurement models for memory tasks in brms. Specifically, a colleague and I have looked at mixture models for visual working memory tasks. To have more flexibility in implementing some models, it would be great if all mixture promotions could be freely estimated. In my mind, this should be similar to setting "refcat = NA" in multinomial or ordinal models. I know that such models require strong priors to be identified. This is something that we would take care of.

The main reason why we would need this functionality is that for some of the mixture models, the mixture proportions are further decomposed into other model parameters. Something like (not complete):

mixFormula <- bf(DV ~ 1,
nlf(theta1 ~ a + b  + c),
nlf(theta2 ~ a + b),
nlf(theta3 ~ a),
a ~ 1 + (1 | ID),
b ~ 1 + (1 | ID),
c ~ 1
)

in the brmsformula. Then some of the model parameters are predicted by independent variables. We could just fix a to zero, but previous implementations have fixed b or c for scaling (e.g., fixing c using a constant prior in this example). So to verify that our implementations recover previous implementations it would be great to be able to flexible set which parameter should be fixed for scaling. I see that this should not be a default setting, but it would still be great to call that option should you need it for specific models.

If you need more specific information, just say so, then I am happy to share more detailed code. Thanks for all your great work. Cheers, Gidon

paul-buerkner commented 1 year ago

Good idea. I will check what needs to be done to make this possible.

GidonFrischkorn commented 1 year ago

Great! Thanks for your quick response.