Dear list, Can anyone provide a package or code for estimating the parameters of a mixture of c (c >=2) univariate normal distributions? I've tried the algorithm provided by Venables & Ripley (1999) p 263, for the mixture of two normal, but I don't find the "ms" function in R. I've used nls instead, but I'm not sure if it works the same. The data I have is very peaked and with long tails. It should be the mixture of two distributions (2 types of particles), possibly with the same mean or very similar means. The QQ plot using the results of the VR algorithm (above), however, still show a clear S shape. Could this mean that there is yet another normal distribution in the mixture, ie c=3? I've started the VR algorithm with different starting points, but they always converge to the same estimates. I have about < 12000 observations, and the VR algorithm converges after about 15 iterations. Thank you for any help. Sharon K?hlmann +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SHARON K?HLMANN-BERENZON Tel. +46-31-772 53 60 Dept. Mathematical Statistics Fax. +46-31-772 35 08 Chalmers University of Tech. e-mail: sharon at math.chalmers.se Eklandagatan 86 412 96 G?teborg, Sweden -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear Sharon, the recent version of the library mclust can fit mixtures of one-dimensional Normal distributions. It provides a decision about the number of components by Bayesian Information criterion, too. Did you consider a single Cauchy or t-distribution for your data? Perhaps the tails of Normal distributions shrink too quickly for your data, so that you would need unreasonable many Normal components? Christian On Tue, 22 Oct 2002, Sharon Kuhlmann-Berenzon wrote:> > Dear list, > > Can anyone provide a package or code for estimating the parameters of a > mixture of c (c >=2) univariate normal distributions? > > I've tried the algorithm provided by Venables & Ripley (1999) p 263, for > the mixture of two normal, but I don't find the "ms" function in R. I've > used nls instead, but I'm not sure if it works the same. > > The data I have is very peaked and with long tails. It should be the > mixture of two distributions (2 types of particles), possibly with the > same mean or very similar means. The QQ plot using the results of the VR > algorithm (above), however, still show a clear S shape. Could this mean > that there is yet another normal distribution in the mixture, ie c=3? > > I've started the VR algorithm with different starting points, but they > always converge to the same estimates. I have about < 12000 > observations, and the VR algorithm converges after about 15 iterations. > > Thank you for any help. > > > Sharon K?hlmann > > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > SHARON K?HLMANN-BERENZON > > Tel. +46-31-772 53 60 Dept. Mathematical Statistics > Fax. +46-31-772 35 08 Chalmers University of Tech. > e-mail: sharon at math.chalmers.se Eklandagatan 86 > 412 96 G?teborg, Sweden > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- *********************************************************************** Christian Hennig Seminar fuer Statistik, ETH-Zentrum (LEO), CH-8092 Zuerich (current) and Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg hennig at stat.math.ethz.ch, http://stat.ethz.ch/~hennig/ hennig at math.uni-hamburg.de, http://www.math.uni-hamburg.de/home/hennig/ ####################################################################### ich empfehle www.boag.de -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 22 Oct 2002, Sharon Kuhlmann-Berenzon wrote:> Can anyone provide a package or code for estimating the parameters of a > mixture of c (c >=2) univariate normal distributions?Alternatives include packages mclust and mda.> I've tried the algorithm provided by Venables & Ripley (1999) p 263, for > the mixture of two normal, but I don't find the "ms" function in R. I've > used nls instead, but I'm not sure if it works the same.Try Venables & Ripley (2002) instead, or even look in the R scripts in the MASS library, specifically the MASS/scripts/ch16.R file. (The version for the 1999 book is MASS/scripts/ch08.R.)> The data I have is very peaked and with long tails. It should be the > mixture of two distributions (2 types of particles), possibly with the > same mean or very similar means. The QQ plot using the results of the VR > algorithm (above), however, still show a clear S shape. Could this mean > that there is yet another normal distribution in the mixture, ie c=3?Well, a mixture of two normals is not long-tailed, so I think you need something else, e.g. a mixture of t's. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
You should be able to use the 'optim' function in R. I think this is demonstrated in MASS 4th edition (not 100% sure). -roger _______________________________ UCLA Department of Statistics rpeng at stat.ucla.edu http://www.stat.ucla.edu/~rpeng On Tue, 22 Oct 2002, Sharon Kuhlmann-Berenzon wrote:> > Dear list, > > Can anyone provide a package or code for estimating the parameters of a > mixture of c (c >=2) univariate normal distributions? > > I've tried the algorithm provided by Venables & Ripley (1999) p 263, for > the mixture of two normal, but I don't find the "ms" function in R. I've > used nls instead, but I'm not sure if it works the same. > > The data I have is very peaked and with long tails. It should be the > mixture of two distributions (2 types of particles), possibly with the > same mean or very similar means. The QQ plot using the results of the VR > algorithm (above), however, still show a clear S shape. Could this mean > that there is yet another normal distribution in the mixture, ie c=3? > > I've started the VR algorithm with different starting points, but they > always converge to the same estimates. I have about < 12000 > observations, and the VR algorithm converges after about 15 iterations. > > Thank you for any help. > > > Sharon Kühlmann > > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > SHARON KÜHLMANN-BERENZON > > Tel. +46-31-772 53 60 Dept. Mathematical Statistics > Fax. +46-31-772 35 08 Chalmers University of Tech. > e-mail: sharon at math.chalmers.se Eklandagatan 86 > 412 96 Göteborg, Sweden > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Tue, 22 Oct 2002, Sharon Kuhlmann-Berenzon wrote:> > Dear list, > > Can anyone provide a package or code for estimating the parameters of a > mixture of c (c >=2) univariate normal distributions? > > I've tried the algorithm provided by Venables & Ripley (1999) p 263, for > the mixture of two normal, but I don't find the "ms" function in R. I've > used nls instead, but I'm not sure if it works the same.optim() is a closer analogue, but if you're assuming normal distributions you should be able to reduce your problem to one that can be handled by least-squares (nls). See the on-line complements, http://www.stats.ox.ac.uk/pub/MASS3/Compl.shtml, under chapter 8 the R complements say: Function nls is in standard package nls . Most of the optimization examples can be done using nlm or optim , but symbolic differentiation using deriv does not work for our examples. See the script ch08.R for details.> The data I have is very peaked and with long tails. It should be the > mixture of two distributions (2 types of particles), possibly with the > same mean or very similar means. The QQ plot using the results of the VR > algorithm (above), however, still show a clear S shape. Could this mean > that there is yet another normal distribution in the mixture, ie c=3?Actually it sounds more like a mixture of t-distributions to me. I'd take a shot at modifying the VR algorithm accordingly. (Although I would note that if the means are very similar you may have some trouble identifying the mixture ...)> I've started the VR algorithm with different starting points, but they > always converge to the same estimates. I have about < 12000 > observations, and the VR algorithm converges after about 15 iterations. > > Thank you for any help. > > > Sharon K?hlmann > > > +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > SHARON K?HLMANN-BERENZON > > Tel. +46-31-772 53 60 Dept. Mathematical Statistics > Fax. +46-31-772 35 08 Chalmers University of Tech. > e-mail: sharon at math.chalmers.se Eklandagatan 86 > 412 96 G?teborg, Sweden > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- 318 Carr Hall bolker at zoo.ufl.edu Zoology Department, University of Florida http://www.zoo.ufl.edu/bolker Box 118525 (ph) 352-392-5697 Gainesville, FL 32611-8525 (fax) 352-392-3704 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
At 17:52 22/10/02 +0100, ripley at stats.ox.ac.uk wrote: [...]>Well, a mixture of two normals is not long-tailed, so I think you need >something else, e.g. a mixture of t's. >Or a mixture of three normals, the third with a large sigma. Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html Department of Statistics, University of Waikato, Hamilton, New Zealand Email: maj at waikato.ac.nz Fax +64-7 838 4155 Phone +64-7 838 4773 wk +64 7 849 6486 home Mobile 021 395 862 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._