On Wed, 12 Dec 2001, Sumithra Mandrekar wrote:
> Can someone suggest how I can fit a mixture of 3
> normals in S-Plus? I have used the code from Venables
> and Ripley, page 292 to fit a mixture of 2 normals. In
> this case, I could specify that the mixing proportion,
> p, ranges from 0 to 1. However, in the case of 3
> normals, I would have to specify that p1+p2+p3 = 1,
> and that each pi ranges between 0 & 1. Is it possible
> for me to specify this additional constraint while
> using the “nlminb” function to estimate the parameters
> / proportions?
No. What you can do is reparametrize as a log-linear model,
so
p1 = 1/(1 + exp(a) + exp(b))
p2 = exp(a)/(1 + exp(a) + exp(b))
p3 = exp(b)/(1 + exp(a) + exp(b))
--
Brian D. Ripley, ripley@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
|