Skip to content

Commit a6d6728

Browse files
committed
update
1 parent a696577 commit a6d6728

File tree

6 files changed

+56
-34
lines changed

6 files changed

+56
-34
lines changed

DESCRIPTION

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: pmclust
22
Version: 0.1-5
3-
Date: 2013-06-13
3+
Date: 2013-05-13
44
Title: Parallel Model-Based Clustering
55
Authors@R: c(person("Wei-Chen", "Chen", role = c("aut", "cre"), email =
66
"[email protected]"), person("George", "Ostrouchov", role = "aut"))
@@ -11,20 +11,21 @@ LazyLoad: yes
1111
LazyData: yes
1212
Description: The pmclust aims to utilize model-based clustering (unsupervised)
1313
for high dimensional and ultra large data, especially in a distributed
14-
manner. The package employs pbdMPI to perform a
14+
manner. The package employs Rmpi to perform a
1515
expectation-gathering-maximization (EGM) algorithm
16-
for finite mixture Gaussian models. The unstructured dispersion
17-
matrices are assumed in the Gaussian models. The implementation is
18-
default in the single program multiple data (SPMD) programming model.
19-
The code can be executed through pbdMPI and independent to most MPI
20-
applications. See the High Performance Statistical Computing (HPSC)
21-
website for more information, documents and examples.
16+
for finite mixture Gaussian
17+
models. The unstructured dispersion matrices are assumed in the Gaussian
18+
models. The implementation is default in the single program multiple
19+
data (SPMD) programming model. The code can be executed through Rmpi and
20+
independent to most MPI applications. See the High Performance
21+
Statistical Computing (HPSC) website for more information, documents
22+
and examples.
2223
License: GPL (>= 2)
2324
URL: http://r-pbd.org/
2425
BugReports: http://group.r-pbd.org/
2526
MailingList: Please send questions and comments regarding pbdR to
2627
27-
Packaged: 2013-05-31 14:21:37 UTC; snoweye
28+
Packaged: 2013-06-19 18:32:45 UTC; snoweye
2829
Author: Wei-Chen Chen [aut, cre],
2930
George Ostrouchov [aut]
3031
Maintainer: Wei-Chen Chen <[email protected]>

R/dmat_em_base.r

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -20,42 +20,42 @@ update.expectation.dmat <- function(PARAM, update.logL = TRUE){
2020
K <- PARAM$K
2121

2222
### WCC: original
23-
.pmclustEnv$U.dmat <- sweep(.pmclustEnv$W.dmat, 2, PARAM$log.ETA, FUN = "+")
23+
# .pmclustEnv$U.dmat <- sweep(.pmclustEnv$W.dmat, 2, PARAM$log.ETA, FUN = "+")
2424
### WCC: temp dmat
2525
# tmp.1 <- sweep(.pmclustEnv$W.dmat, 2, PARAM$log.ETA, FUN = "+")
2626
# .pmclustEnv$U.dmat <- tmp.1
2727
### WCC: temp spmd
28-
# tmp.1 <- as.matrix(.pmclustEnv$W.dmat)
29-
# tmp.2 <- sweep(tmp.1, 2, PARAM$log.ETA, FUN = "+")
30-
# .pmclustEnv$U.dmat <- as.ddmatrix(tmp.2)
28+
tmp.1 <- as.matrix(.pmclustEnv$W.dmat)
29+
tmp.2 <- sweep(tmp.1, 2, PARAM$log.ETA, FUN = "+")
30+
.pmclustEnv$U.dmat <- as.ddmatrix(tmp.2)
3131

3232
### WCC: original
33-
.pmclustEnv$Z.dmat <- exp(.pmclustEnv$U.dmat)
33+
# .pmclustEnv$Z.dmat <- exp(.pmclustEnv$U.dmat)
3434
### WCC: temp dmat
3535
# tmp.1 <- exp(.pmclustEnv$U.dmat)
3636
# .pmclustEnv$Z.dmat <- tmp.1
3737
### WCC: temp spmd
38-
# tmp.1 <- as.matrix(.pmclustEnv$U.dmat)
39-
# tmp.2 <- exp(tmp.1)
40-
# .pmclustEnv$Z.dmat <- as.ddmatrix(tmp.2)
38+
tmp.1 <- as.matrix(.pmclustEnv$U.dmat)
39+
tmp.2 <- exp(tmp.1)
40+
.pmclustEnv$Z.dmat <- as.ddmatrix(tmp.2)
4141

4242
### WCC: original
43-
tmp.id <- rowSums(.pmclustEnv$U.dmat < .pmclustEnv$CONTROL$exp.min) == K |
44-
rowSums(.pmclustEnv$U.dmat > .pmclustEnv$CONTROL$exp.max) > 0
45-
tmp.id <- as.logical(as.vector(tmp.id))
43+
# tmp.id <- rowSums(.pmclustEnv$U.dmat < .pmclustEnv$CONTROL$exp.min) == K |
44+
# rowSums(.pmclustEnv$U.dmat > .pmclustEnv$CONTROL$exp.max) > 0
45+
# tmp.id <- as.logical(as.vector(tmp.id))
4646
### WCC: temp dmat
47-
# tmp.1 <- .pmclustEnv$U.dmat < .pmclustEnv$CONTROL$exp.min
48-
# tmp.1 <- as.matrix(tmp.1)
49-
# tmp.2 <- rowSums(tmp.1)
50-
# tmp.3 <- tmp.2 == K
51-
# tmp.4 <- .pmclustEnv$U.dmat > .pmclustEnv$CONTROL$exp.max
52-
# tmp.4 <- as.matrix(tmp.4)
53-
# tmp.5 <- rowSums(tmp.4)
54-
# tmp.6 <- tmp.5 > 0
55-
# tmp.7 <- tmp.3 | tmp.6
56-
# tmp.8 <- as.vector(tmp.7)
57-
# tmp.id <- tmp.8
58-
# tmp.id <- as.logical(tmp.id)
47+
tmp.1 <- .pmclustEnv$U.dmat < .pmclustEnv$CONTROL$exp.min
48+
tmp.1 <- as.matrix(tmp.1)
49+
tmp.2 <- rowSums(tmp.1)
50+
tmp.3 <- tmp.2 == K
51+
tmp.4 <- .pmclustEnv$U.dmat > .pmclustEnv$CONTROL$exp.max
52+
tmp.4 <- as.matrix(tmp.4)
53+
tmp.5 <- rowSums(tmp.4)
54+
tmp.6 <- tmp.5 > 0
55+
tmp.7 <- tmp.3 | tmp.6
56+
tmp.8 <- as.vector(tmp.7)
57+
tmp.id <- tmp.8
58+
tmp.id <- as.logical(tmp.id)
5959

6060
tmp.flag <- sum(tmp.id)
6161
if(tmp.flag > 0){

R/dmat_em_initial.r

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ initial.em.dmat <- function(PARAM, MU = NULL){
2424
# -1.3357516, 0.5336209, 1.2700404,
2525
# -1.3110521, 0.2632600, 1.7063794
2626
# )
27-
# PARAM$MU <- matrix(PARAM$MU, nrow = 4)
27+
PARAM$MU <- c(
28+
0.2328901, 0.7281706, -1.0026075,
29+
-0.6238820, -0.2584021, 0.8862744,
30+
0.4944164, 0.7662080, -1.2993873,
31+
0.4674663, 0.7461591, -1.2516524
32+
)
33+
PARAM$MU <- matrix(PARAM$MU, nrow = 4)
2834

2935
e.step.dmat(PARAM)
3036
PARAM <- em.onestep.dmat(PARAM)

R/dmat_em_logdmvnorm.r

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,15 @@ logdmvnorm.dmat <- function(PARAM, i.k){
3939
tmp.3 <- as.matrix(.pmclustEnv$W.dmat)
4040
tmp.3[, i.k] <- tmp.2
4141
.pmclustEnv$W.dmat <- as.ddmatrix(tmp.3)
42+
43+
# B <- sweep(X.dmat, 2, PARAM$MU[, i.k])
44+
# C <- backsolve(U, diag(1, PARAM$p))
45+
# B <- B %*% as.ddmatrix(C)
46+
# distval <- rowSums(B * B)
47+
# distval <- as.vector(distval)
48+
# .pmclustEnv$W.dmat[, i.k] <- -(.pmclustEnv$p.times.logtwopi + logdet +
49+
# distval) * 0.5
50+
4251
# }
4352
invisible()
4453
} # End of logdmvnorm.dmat().

R/pm_em_initial.r

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ initial.em.spmd <- function(PARAM, MU = NULL){
5555
# -1.3357516, 0.5336209, 1.2700404,
5656
# -1.3110521, 0.2632600, 1.7063794
5757
# )
58-
# PARAM$MU <- matrix(PARAM$MU, nrow = 4)
58+
PARAM$MU <- c(
59+
0.2328901, 0.7281706, -1.0026075,
60+
-0.6238820, -0.2584021, 0.8862744,
61+
0.4944164, 0.7662080, -1.2993873,
62+
0.4674663, 0.7461591, -1.2516524
63+
)
64+
PARAM$MU <- matrix(PARAM$MU, nrow = 4)
5965

6066
e.step.spmd(PARAM)
6167
PARAM <- em.onestep.spmd(PARAM)

inst/doc/pmclust-guide.pdf

-76 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)