Modeling the temporal dynamics of the gut microbial community in adults and infants