gmmfit
1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | x1 = rmvnorm(50, mean=rep(-1,4))
x2 = rmvnorm(50, mean=rep(+1,4))
xx = rbind(x1, x2)
cl1 = fitgmm(xx, k=1)
cl2 = fitgmm(xx, k=2)
cl3 = fitgmm(xx, k=3)
cls = array(0,c(10,3))
for (i in 1:10){
cls[i,] = as.vector(fitgmm(xx, k=i, method="diag")$criteria)
print(paste("iteration ",i," complete..",sep=""))
}
yy = c(rnorm(30,mean=-1),rnorm(30,mean=1))
cls = array(0,c(10,3))
for (i in 1:10){
cls[i,] = as.vector(fitgmm(yy, k=i, method="diag")$criteria)
print(paste("iteration ",i," complete..",sep=""))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.