Skip to content
Back to formatted view

Raw Message

Message-ID: <Pine.LNX.4.64.0904301212590.31661@egon.stats.ucl.ac.uk>
Date: 2009-04-30T11:26:19Z
From: Christian Hennig
Subject: finite mixture model (2-component Weibull): plotting Weibull components?
In-Reply-To: <749170.57443.qm@web25508.mail.ukl.yahoo.com>

mclust doesn't do Weibull mixtures, only Gaussian ones (though you may 
approximate a Weibull by several Gaussians). You may look up the flexmix 
package, which either does it already or a method function can be provided
to do it.
There is also an example "fitting a mixture distribution" in Venables and 
Ripley's MASS book with normals (including plotting the density), which 
you could adapt for Weibull distributions by plugging in the 
corresponding functions for the Weibull.

> (1) restrict the number of components to 2 .

Specify G=2 in mclust (if want to fit 2 Gaussians).

> (2) obtain and plot a component Weibull density

Generally, adding a Weibull mixture density to a plot works by

x <- seq(0,100,by=0.1)
# or whatever reasonable choice of x-values
lines(x,p*dweibull(x,s11,s12)+(1-p)*dweibull(x,s21,s22))

where p, s11, s12, s21, s22 are the mixture parameters.

Regards,
Christian

*** --- ***
Christian Hennig
University College London, Department of Statistical Science
Gower St., London WC1E 6BT, phone +44 207 679 1698
chrish at stats.ucl.ac.uk, www.homepages.ucl.ac.uk/~ucakche