Fitting a Mixture of Von Mises and Uniform Distributions in brms


#1

I just discovered that BRMS is capable of fitting mixture models – is there anything it can’t do?!

In my field, I sometimes analyze data as arising from the mixture of a von mises and a uniform distribution with various predictors applied to Kappa and to the mixing proportions. In the past, I’ve had to code these models in base Stan. In following along with the documentation for the mixture() function. I think I understand how it works and have been able to fit a variety of mixtures using typical distributions (e.g., Normal). However, I cannot seem to work out how to incorporate a uniform distribution (ranging from -pi to pi). Is there a simple or preset way to do this with resorting to hacks?

Apologies in advance if I am being daft…

  • Operating System: OSX 10.13.6
  • brms Version: 2.6.0

#2

Using customfamily you can make your own custom family for the uniform distribution. Once you done that, you can do stuff along the following lines:

bform <- bf(
  mu1 ~ <predictors>,
  mu2 ~ 0,
  family = mixtrue(von_mises(), custom_uniform)
)