becker@kfs.oeaw.ac.at
2005-Mar-07 09:35 UTC
[Rd] R crashes using the em function of package mclust (PR#7719)
Hi, I got the same problem like http://tolstoy.newcastle.edu.au/R/devel/04/11/1204.html R crashes when I use the em function from the mclust package on univariate data and on a special case on bivariate data (when the matrix is not provided as written in the manual). It seems as if the problem is the format of the data to be analyzed. Operating System: Windows XP (SP2) R version: R-2.0.1 The following example causes a crash of R: # univariate example require(mclust) X <- c(rnorm(100, mean=1), rnorm(100, mean=5)) # I also tried: X <- as.matrix(c(rnorm(100, mean=1), rnorm(100, mean=5))) Xmap <- cbind(c(rep(1, 100), rep(0, 100)), c(rep(0, 100), rep(1, 100))) Xm <- mstep(modelName="V", data=X, z=Xmap) # CRASH: em(modelName=Xm$modelName, data=X, mu=Xm$mu, sigmasq=Xm$sigmasq, pro=Xm$pro) For bivariate data the following example works: # bivariate example require(mclust) Y <- as.matrix(cbind(c(rnorm(100, mean=1), rnorm(100, mean=5)), c(rnorm(100, mean=1), rnorm(100, mean=5)))) Ymap <- cbind(c(rep(1, 100), rep(0, 100)), c(rep(0, 100), rep(1, 100))) Ym <- mstep(modelName="EEE", data=Y, z=Ymap) # NO CRASH: em(modelName=Ym$modelName, data=Y, mu=Ym$mu, sigmasq=Ym$Sigma, pro=Ym$pro) But when the variables are not columns (as written in the mclust manual) but rows, R crashes again: # CRASH: em(modelName=Ym$modelName, data=t(Y), mu=Ym$mu, sigmasq=Ym$Sigma, pro=Ym$pro) Perhaps this is a hint to the origin of the problem. I could not use the em function for univariate data successfully yet. Perhaps anyone can provide a working example for univariate data? Thanks in advance.
Brian D Ripley
2005-Mar-07 10:15 UTC
[Rd] R crashes using the em function of package mclust (PR#7719)
Please read the FAQ and report this in the correct place: Bug reports on contributed packages should be sent first to the package maintainer, and only submitted to the R-bugs repository by package maintainers, mentioning the package in the subject line. You are not the named maintainer. On Mon, 7 Mar 2005 becker@kfs.oeaw.ac.at wrote:> Hi, > > I got the same problem like > http://tolstoy.newcastle.edu.au/R/devel/04/11/1204.html > > R crashes when I use the em function from the mclust package on > univariate data and on a special case on bivariate data (when the matrix > is not provided as written in the manual). > It seems as if the problem is the format of the data to be analyzed. > > Operating System: Windows XP (SP2) > R version: R-2.0.1 > > The following example causes a crash of R: > > # univariate example > require(mclust) > X <- c(rnorm(100, mean=1), rnorm(100, mean=5)) > # I also tried: X <- as.matrix(c(rnorm(100, mean=1), rnorm(100, mean=5))) > Xmap <- cbind(c(rep(1, 100), rep(0, 100)), c(rep(0, 100), rep(1, 100))) > Xm <- mstep(modelName="V", data=X, z=Xmap) > # CRASH: > em(modelName=Xm$modelName, data=X, mu=Xm$mu, sigmasq=Xm$sigmasq, pro=Xm$pro) > > For bivariate data the following example works: > > # bivariate example > require(mclust) > Y <- as.matrix(cbind(c(rnorm(100, mean=1), rnorm(100, mean=5)), > c(rnorm(100, mean=1), rnorm(100, mean=5)))) > Ymap <- cbind(c(rep(1, 100), rep(0, 100)), c(rep(0, 100), rep(1, 100))) > Ym <- mstep(modelName="EEE", data=Y, z=Ymap) > # NO CRASH: > em(modelName=Ym$modelName, data=Y, mu=Ym$mu, sigmasq=Ym$Sigma, pro=Ym$pro) > > But when the variables are not columns (as written in the mclust manual) > but rows, R crashes again: > > # CRASH: > em(modelName=Ym$modelName, data=t(Y), mu=Ym$mu, sigmasq=Ym$Sigma, > pro=Ym$pro) > > Perhaps this is a hint to the origin of the problem. > I could not use the em function for univariate data successfully yet. > Perhaps anyone can provide a working example for univariate data? > > Thanks in advance. > > ______________________________________________ > R-devel@stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel >-- 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 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
murdoch@stats.uwo.ca
2005-Mar-07 10:20 UTC
[Rd] R crashes using the em function of package mclust (PR#7719)
On Mon, 7 Mar 2005 09:35:39 +0100 (CET), becker@kfs.oeaw.ac.at wrote :>Hi, > >I got the same problem like >http://tolstoy.newcastle.edu.au/R/devel/04/11/1204.html > >R crashes when I use the em function from the mclust package on >univariate data and on a special case on bivariate data (when the matrix >is not provided as written in the manual). >It seems as if the problem is the format of the data to be analyzed. > >Operating System: Windows XP (SP2) >R version: R-2.0.1 > >The following example causes a crash of R: > ># univariate example >require(mclust) >X <- c(rnorm(100, mean=1), rnorm(100, mean=5)) ># I also tried: X <- as.matrix(c(rnorm(100, mean=1), rnorm(100, mean=5))) >Xmap <- cbind(c(rep(1, 100), rep(0, 100)), c(rep(0, 100), rep(1, 100))) >Xm <- mstep(modelName="V", data=X, z=Xmap) ># CRASH: >em(modelName=Xm$modelName, data=X, mu=Xm$mu, sigmasq=Xm$sigmasq, pro=Xm$pro)Which version of mclust? I just installed 2.1-8 and ran your code in R-2.0.1 with no problem. In any case, this looks more like an mclust problem than an R problem; if you're using the current version, you should follow up with the maintainer, Ron Wehrens <R.Wehrens@science.ru.nl>. Duncan Murdoch
becker@kfs.oeaw.ac.at
2005-Mar-07 10:36 UTC
[Rd] R crashes using the em function of package mclust (PR#7719)
Duncan Murdoch schrieb:>On Mon, 7 Mar 2005 09:35:39 +0100 (CET), becker@kfs.oeaw.ac.at wrote >: > > > >>Hi, >> >>I got the same problem like >>http://tolstoy.newcastle.edu.au/R/devel/04/11/1204.html >> >>R crashes when I use the em function from the mclust package on >>univariate data and on a special case on bivariate data (when the matrix >>is not provided as written in the manual). >>It seems as if the problem is the format of the data to be analyzed. >> >>Operating System: Windows XP (SP2) >>R version: R-2.0.1 >> >>The following example causes a crash of R: >> >># univariate example >>require(mclust) >>X <- c(rnorm(100, mean=1), rnorm(100, mean=5)) >># I also tried: X <- as.matrix(c(rnorm(100, mean=1), rnorm(100, mean=5))) >>Xmap <- cbind(c(rep(1, 100), rep(0, 100)), c(rep(0, 100), rep(1, 100))) >>Xm <- mstep(modelName="V", data=X, z=Xmap) >># CRASH: >>em(modelName=Xm$modelName, data=X, mu=Xm$mu, sigmasq=Xm$sigmasq, pro=Xm$pro) >> >> > >Which version of mclust? I just installed 2.1-8 and ran your code >in R-2.0.1 with no problem. > > >I used 2.1-6. As you say 2.1-8 runs with no problem. Sorry, my fault.>In any case, this looks more like an mclust problem than an R problem; >if you're using the current version, you should follow up with the >maintainer, Ron Wehrens <R.Wehrens@science.ru.nl>. > >Duncan Murdoch > > >