plotting-functionalities: Plotting functionalities for Gaussian covariance and...

Description Usage Arguments Details Examples

Description

Plotting functionalities for objects of class fitGGM or mixGGM.

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'fitGGM'
plot(x, what = c("graph", "adjacency"),
    layout = c("circle", "random"), ...)

## S3 method for class 'mixGGM'
plot(x, what = c("graph", "classification", "adjacency", "common"),
    layout = c("circle", "random"),
    colors = NULL, symb = NULL, dimens = NULL, ...)

Arguments

x

An object of class fitGGM or mixGGM.

what

The type of plot to be produced. If what = "graph" (default), the graph(s) corresponding to the association structure(s) among the variables is displayed; if what = "adjacency" and heat-map representing the binary entries of the adjacency matrix is produced; if what = "classification" the function produces a scatterplot showing the clustering of the observations; if what = "common" the graph intersection of the mixture components graphs is produced, which display the edges common across the clusters. See "Details".

layout

Layout of the graph, either circular (default) or random.

colors

A vector of user defined colors

symb

A vector of user defined symbols

dimens

A vector giving the integer dimensions of the desired variables for multivariate data in case of what = "classification".

...

Other arguments.

Details

These functions are used to visualize graph association structures and clustering results for single and mixtures of Gaussian covariance and concentration models.

In the case of what = "graph", the graph of a Gaussian covariance graph model is bi-directed, while the graph of a Gaussian concentration model is un-directed. Thickness of the edges is proportional to the estimated association parameters.

See "Examples" for various cases.

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
# covariance graph
data(mtcars)
x <- mtcars[,c(1,3:7)]
R <- cor(x)
graph <- ( abs(R) < 0.5 )*1
diag(graph) <- 0
fit1 <- fitGGM(data = x, graph = graph)
plot(fit1)
plot(fit1, what = "adjacency")


# concentration graph
data(swiss)
V <- ncol(swiss)
graph <- matrix( c(0,1,0,1,1,1,
                   1,0,1,1,0,0,
                   0,1,0,1,1,0,
                   1,1,1,0,1,0,
                   1,0,1,1,0,0,
                   1,0,0,0,0,0), V,V, byrow = TRUE )
fit2 <- fitGGM(swiss, graph = graph, model = "concentration")
plot(fit2)
plot(fit2, layout = "random")
plot(fit2, what = "adjacency")


## Not run: 

# mixture of Gaussian concentration graph models
data(banknote, package = "mclust")
mod3 <- mixGGM(banknote[,-1], model = "concentration", K = 2)
plot(mod3, what = "graph")
plot(mod3, what = "adjacency")
plot(mod3, what = "classification")
plot(mod3, what = "classification", dimens = c(1,4,5))
plot(mod3, what = "common")


# mixture of Gaussian covariance graph models
data(wine, package = "gclus")
mod4 <- mixGGM(wine[,-1], model = "covariance", K = 3)
clb <- c("#999999", "#E69F00", "#56B4E9")                 # colorblind friendly palette
plot(mod4, what = "graph", colors = clb)
plot(mod4, what = "adjacency", colors = clb)
plot(mod4, what = "classification", colors = clb, dimens = c(1,7,8,12))
plot(mod4, what = "common")


## End(Not run)

michaelfop/mixggm documentation built on Oct. 27, 2018, 12:14 a.m.