Matrix population models are widely used to predict population dynamics but, when applied to species rich ecosystems with many rare species, the small population sample sizes hinder a good fit of species-specific models. This issue can be overcome by assigning species to groups to increase the size of the calibration data sets. However, the species classification is often disconnected from the models and from the parameter estimation, thus bringing species groups that may not be optimal with respect to the predicted community dynamics. We proposed here a method that jointly classified species into groups and fit the matrix models in an integrated way. The model was a special case of mixture with unknown number of components and was cast in a Bayesian framework. An MCMC algorithm was developed to infer the unknown parameters: the number of groups, the group of each species and the dynamics parameters. We applied the method to a data set from a tropical rain forest in French Guiana.