GSAC: GSAC

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The generalized sort-and-cut algorithm. Reordering via optile and partitioning via cfluctile are iteratively combined to a clustering algorithm.

Usage

1
2
3
4
gsac(x, nc = Inf, maxiter = 40, zero = TRUE, r0 = 0,
 force.cs = FALSE, force.rs = FALSE, resort = "complete",
 method = "Kendall", tau0 = 0.5, stack = "max", clean = TRUE,
 clean.Is = TRUE, cutoff = -20, ... )

Arguments

x

The data matrix.

nc

The desired maximum number of clusters. Useful to restrict the algorithm further.

maxiter

Maximum number of iterations. Depending on the partitioning method/threshold and the size of the matrix the number of steps can sometimes become very large.

zero

Each partition identifies a sparse part of the table. If zero = TRUE this part is set to 0 or r0 times the expectation from the marginals.

r0

A parameter controlling how sparse areas are handled. Usually left at zero, which means that sparse areas are zeroed.

force.cs

Logical. If TRUE clusters may not share columns.

force.rs

Logical. If TRUE clusters may not share rows.

resort

The reordering variation: "none" for no subtable reordering, "c" for restricted common reordering (the subtables share the orders), "s" for independent/unrestricted reordering.

method

Method used for the partitioning via cfluctile.

tau0

Threshold used for the partitioning via cfluctile.

stack

The rule which element (cluster) from the list to use next. "last" is the FILO and "first" uses FIFO. "max" and "min" mean that the largest / the smallest elements will be handled first.

clean

Whether or not to clean the results using setcover.

clean.Is

Whether or not to check the current list of non-finished clusters for redundancies.

cutoff

Clusters are pruned by removing rows and columns with an average residual below this value.

...

Further arguments passed to optile.

Details

The clusters are returned as a 2D list. The first element lists the clusters by their row indices vectors, the seond element lists the corresponding column indices. This can be used with getIs and heattile.

Value

A 2D list: row and column indices of the clusters.

Author(s)

Alexander Pilhoefer

See Also

sortandcut, cfluctile

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
## Not run: 	
ss <- sample(1:nrow(plants),500)
M <- t( as.matrix(plants[ss,-1]) )

gs <- gsac(M, fun="IBCC", foreign=".Call")

heattile(M, Is = getIs2(gs, dim(M)), fluct = TRUE, hm.palette = 1)	

## End(Not run)
	
# simulated example:

A <- arsim(3000,c(8,5),1)
B <- arsim(2000,c(7,6),1)
C <- arsim(4000,c(9,9),1)
M <- matrix(0,16,16)

M[1:8,1:5] <- A
M[4:10,6:11] <- B
M[8:16,8:16] <- C

M <- as.table(optile(M, iter=20))
t0 <- 0.6

# no subtable reordering
test1 <- gsac(M,resort="none",method= "BCI", tau0=t0)

require(scales)
heattile(M,Is=test1,hm.palette=alpha(1,0.8),shape="r",
fluct = TRUE, label = c(TRUE,TRUE),bg.col=NA, lab.opt = list(rot=c(0,90)))


## Not run: 
# unrestricted subtable reordering
test2 <- gsac(M,resort="s", method= "BCI", tau0=t0)

#common reordering
test3 <- gsac(M,resort="c", method= "BCI", tau0=t0)

# clusters do not share rows, columns, both
test4 <- gsac(M,resort="s",force.cs=TRUE,method = "BCI", tau0=t0)
test5 <- gsac(M,resort="s",force.rs=TRUE,method = "BCI", tau0=t0)
test6 <- gsac(M,resort="s",force.rs=TRUE,force.cs=TRUE, tau0=t0)

## End(Not run)


## Not run: 
heattile(M,Is=test2,hm.palette=alpha(1,0.8),shape="r",
fluct = TRUE, label = c(TRUE,TRUE),bg.col=NA, lab.opt = list(rot=c(0,90)))

heattile(M,Is=test3,hm.palette=alpha(1,0.8),shape="r",
fluct = TRUE, label = c(TRUE,TRUE),bg.col=NA, lab.opt = list(rot=c(0,90)))

heattile(M,Is=test4,hm.palette=alpha(1,0.8),shape="r",
fluct = TRUE, label = c(TRUE,TRUE),bg.col=NA, lab.opt = list(rot=c(0,90)))

heattile(M,Is=test5,hm.palette=alpha(1,0.8),shape="r",
fluct = TRUE, label = c(TRUE,TRUE),bg.col=NA, lab.opt = list(rot=c(0,90)))

heattile(M,Is=test6,hm.palette=alpha(1,0.8),shape="r",
fluct = TRUE, label = c(TRUE,TRUE),bg.col=NA, lab.opt = list(rot=c(0,90)))

## End(Not run)

extracat documentation built on July 17, 2018, 5:05 p.m.

Related to GSAC in extracat...