Hi R-helpers, I'm trying to model a univariate as a bi-modal normal mixtures. I need to estimate the parameters of each gaussian (mean and sd) and their weights. What's the best way to do this in R? Thanks, Xiao-Jun
Xiao-Jun Ma wrote:> Hi R-helpers, > > I'm trying to model a univariate as a bi-modal normal mixtures. I need to estimate the parameters of each gaussian (mean and sd) and their weights. What's the best way to do this in R? > > Thanks, > > Xiao-Jun > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.htmlpackage:mclust should help. Please read the posting guide. This question was asked less than two weeks ago and the answer should surely be in the mail archives. --sundar
This seems like such a trivial thing to do: given a data.frame DF and variables w,v, x,y,z I can do DF["x"] or DF[c("x","y")] if I create a vector, mylist = c("x",y") then I do DF[mylist] I am not getting x and y, I get something else. what is the correct way to subset a data.frame by columns using a vector, as if I were doing DF["x","y"]? Peter
Peter Wilkinson wrote:> This seems like such a trivial thing to do: > > given a data.frame DF and variables w,v, x,y,z I can do > > DF["x"] or DF[c("x","y")] > > if I create a vector, mylist = c("x",y") > > then I do DF[mylist] > > I am not getting x and y, I get something else. > > > what is the correct way to subset a data.frame by columns using a > vector, as if I were doing DF["x","y"]? > > Peter > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.htmlYou want DF[, mylist]. DF[mylist] returns a list. You may want to look at "An Introduction to R", which covers this topic. --sundar P.S. Please create a new e-mail when posting to the list rather than replying to a message and just changing the subject. This is (of course) covered in the posting guide.