Windows 10. R version 3.6.3. brms version 2.13.3.
I am trying to understand mixture models for longitudinal data. An example (I think this is a growth mixture model) would be participants who are measured on some outcome over time. They eventually group into different trajectories of the outcome over time (these group memberships are not known beforehand). Thus, the data can be thought of as coming from a mixture of distributions.
I have attached the code where I simulate such data and provide a fully reproducible example.
example longitudinal mixture model code.txt (1.8 KB)
Here is a plot of the data.
Neither of the two mixture models converge, even though (I think) the priors are pretty decent.
Running more iterations doesn’t help.
This seems like a pretty simple example… perhaps my simulated data is poor and I fundamentally misunderstand mixture models? I feel like the answer is probably something simple.
Any thoughts on why I can’t get this example to run?