This is a well-written blog on how we can fit a mixture of beta distributions to a dataset:
http://varianceexplained.org/r/mixture-models-baseball/
However, it would have been excellent to identify the optimal number of beta distributions one can fit a beta mixture model. I think one could figure this out using AIC/BIC but I am not sure how to do this or if there is already a package (preferably in R) that could do this. Any insights will be much appreciated. Thanks.