This is duplicate with Could you help me with dirichlet process mixture model?. I will close this post.