FOR BETTER PERFORMANCE USE THE RDONLP2 PACKAGE (SEE INSTRUCTIONS BELOW). depmix is a package for fitting multigroup mixtures of latent/hidden Markov models for arbitrary length multivariate timeseries data of mixed categorical and continuous variables. This includes as special cases the following models: finite mixtures and latent class models (T=1), the latent Markov model for univariate and multivariate timeseries, and mixtures of the latter. Moreover, it includes the possibility of specifying general linear constraints between parameters. The possible response distributions are the multinomial and the gaussian (normal). Analytic gradients are implemented. Standard errors are computed based on a finite differences approximation of the Hessian using the analytic gradients. Parameter estimation is done by direct optimization of the likelihood using reparametrization (for the linear equality constraints) and a penalty function for violoation of inequality constraints. The use of the Rdonlp2 package for optimization is recommended as it deals much better with general linear constraints; furthermore, there is optional support for using NPSOL. USING RDONLP2 Optimization of these models works much better using Rdonlp2. To get this to work do the following: 1) Install the Rdonlp2 package (from http://arumat.net/Rdonlp2/, the licencse says, among other things, "The free use of donlp2 and parts of it is restricted for research purposes.") 2) Change the default optimization option in the function fitdmm, ie the method argument, to "donlp", ie set method="donlp". 3) Install depmix.