Having some trouble with a growth mixture model. I looked to previous examples in the /models/passing directory (specifically LCAlazarsfeld.R, Acemix.R and Acemix2.R) and thought the code below would work. To summarize, I created two models for the two classes (differing in a small set of parameters a, r and d), and put them both in a parent model that contains the data and an objective function that sums the (vectorized) objective functions from the two child models. When run, the code below fixes the class probabilities at .5 for each class and yields the same -2LL as the single-class model. Parameters stayed fixed at their starting values for the class-dependent parameters, with standard errors at zero.
My conceptual problem with the code is with the class probability variable as a scalar value, when I would think it would be individually varying. Any help you can give would be appreciated.
|Gompertz Mixture.R ||8.19 KB|