[R] package mclust: cdens, EMclust?
Karen Green
karengreenphd at yahoo.com
Sat Oct 22 10:33:59 CEST 2005
Dear Knowledgeable R Community Members,
Please excuse my ignorance -- I apologize in advance
if this is an easy question, but I am a bit stumped
and could use a little guidance regarding parameters
in 2 functions in the "mclust" package.
--------------------
PROBLEM DESCRIPTION
--------------------
I have a finite mixture modeling problem -- for
example, a 2-component gaussian mixture -- where the
components have a large overlap, and I am trying to
use the "mclust" package to solve this problem.
I need to decompose that mixture into its 2 components
which will need to be plotted.
-----------
QUESTIONS
-----------
What I don't know how to do is:
(1) restrict the number of components to 2 in the
"EMclust" function
(2) obtain and plot a component gaussian density
Regarding (1), I think this should be the 'G' value
but the documentation is somewhat cryptic as regards
the format. Regarding (2), I think I need to use the
"cdens" function, but again the documentation is
somewhat cryptic.
--------------------
SAMPLE CODE
--------------------
Here is a little test script to illustrate. (Note: my
real dataset will not have peaks this well separated,
but I needed to find a small example.)
##################
data(faithful)
library(mclust)
MyMixtureModel<-summary(EMclust(faithful$eruptions),faithful$eruptions)
attach(MyMixtureModel)
mclust1Dplot(data=faithful$eruptions,z=z,mu=mu,sigmasq=sigmasq,pro=pro,ask=FALSE,type=c("density"))
do.call("mclust1Dplot",c(list(data=faithful$eruptions,ask=FALSE,type=c("density")),MyMixtureModel))
# plot components
???
##################
Any information you might be able to shed on this
would be very much appreciated.
With appreciation for your help,
Karen
---
Karen M. Green, Ph.D.
Research Investigator
Drug Design Group
Sanofi Aventis Pharmaceuticals
Tucson, AZ
USA
More information about the R-help
mailing list