How do i fit a mixture model?
August 27, 2007 4:17 AM   Subscribe

StatisticsFilter: What is the easiest way to estimate parameters of a mixture model consisting of two normal distributions?

I have minitab here on my computer but can't find anyhing in the help about mixture models. I can access SAS and SPSS from school so solutions in those systems are welcome too.

I have tried the SCOR java app at but couldnt get it to work properly. I would preferably use the ME method.
posted by ilike to Science & Nature (7 answers total) 2 users marked this as a favorite
 
If you're willing to use R, which is free, the Rmix package appears to do what you want.
posted by grouse at 4:23 AM on August 27, 2007


Response by poster: R is probably great but it is hard to use. Is there some addons that will ease things as importing data and browsing the datasets? I also need a plotting solution that will do nice "modern" vector style graphs. Preferably all this will be easy to use in a windows enviroment without to much terminal use.
posted by ilike at 5:03 AM on August 27, 2007


Via hubster: The easiest way to do this is to use maximum likelihood estimation in Excel. The solver routine will find the parameters.

If you're not familiar with this approach, it is well worth a small investment of time to learn.

Good luck.
posted by pammo at 5:12 AM on August 27, 2007


Response by poster: pammo: What is hubster? Could you send me the link? It would be greatly appreciated.
posted by ilike at 5:21 AM on August 27, 2007


There are some simple GUI interfaces available for R (see here). I've not used them and it looks like they are underdevelopment. I expect they will help you to look at your data tables but I doubt if they will extend to doing any more than fairly simple statistics.

If you really can't stomach learning some of the command line (it's really not that hard once you get into it and there are some excellent teaching materials available) then your best bet is probably to learn more of SAS. I'm fairly sure SAS has some procedures for fitting these models (NLMIXED?) but I've only dabbled with SAS and can't help further
posted by jonesor at 5:26 AM on August 27, 2007


hubster = significant other, who points you to this pdf.

Go to page 3 and use the formula under "likelihood function."

Program this function into Excel. It will have a value for each of your datapoints. So for example if column A has your data, make column B the value of this function for each of these data points. You need to add up the values in column B and maximize this value using solver.

K = number of normals you want ( I presume 2, so each value in column B is the sum of two of these)
Mu(1,2), and sigma(1,2) are the respective parameters of the two normals – solver will find these.

Phi is the mixture. You can tell solver that phi1 + phi2 = 1 is a constraint.

Then have solver maximize the sum of column B, subject to the one constraint above, by searching for the 5 parameters.
posted by pammo at 6:10 AM on August 27, 2007


I guess I should say that my husband is a mathematician, or perhaps that's obvious by now. I'm a lowly MD, for what it's worth.
posted by pammo at 6:13 AM on August 27, 2007


« Older La cosa nostra   |   Hey man, is that a crowbar in your pocket or are... Newer »
This thread is closed to new comments.