code to estimate mixture proportions