I’m trying to fit a 2-component Gaussian mixture model using brms. Let’s say I have two covariates, x and z, that I want to use to model the two means, mu1 and mu2. In addition I would like to add the constraint that the effect of x is the same on both mu1 and mu2 while the effect of z is component specific.
I’m using splines so my first approach looks something like this:
m <- brm(bf(y ~ 1, mu1 ~ s(x) + s(z), mu2 ~ s(x) + s(z)), dTotal, family = mixture(gaussian, gaussian), iter = 10^4, chains = 4, cores = 4)
which works, but now I would like to add the restriction that the the
s(x) term is exactly the same for mu1 and mu2 while the two
s(z) terms are different. Is that possible?
Thanks in advance!