plot.cggm: Plot Method for a "cggm" Object

View source: R/cggm_S3methods.R

plot.cggmR Documentation

Plot Method for a ‘cggm’ Object

Description

The plot.cggm produces graphs from an R object of class ‘cggm’.

Usage

## S3 method for class 'cggm'
plot(x, type, weighted = FALSE, simplify = TRUE, ...)

Arguments

x

an R object of class ‘cggm’, that is, the output of the function cggm.

type

a description of the required graph. Default depends on the type of fitted model, that is, type = both if a conditional censored graphical lasso estimator is fitted, otherwise type is equal to Gyy (see getGraph) for more details.

weighted

logical. Should weighted graphs be created? Default is FALSE.

simplify

logical. Should isolated vertices be removed from the graph? Default is TRUE, i.e., isolated vertices are removed.

...

additional graphical arguments passed to the functions plot.igraph.

Author(s)

Luigi Augugliaro (luigi.augugliaro@unipa.it)

See Also

cggm, to_graph, getGraph and plot.cglasso2igraph.

Examples

set.seed(123)
# Y ~ N(XB, Sigma)  and
# 1. probability of left/right censored values equal to 0.05
# 2. probability of missing-at-random values equal to 0.05
n <- 100L
p <- 3L
q <- 2L
b0 <- runif(p)
B <- matrix(runif(q * p), nrow = q, ncol = p)
X <- matrix(rnorm(n * q), nrow = n, ncol = q)
rho <- 0.3
Sigma <- outer(1L:p, 1L:p, function(i, j) rho^abs(i - j))
Z <- rcggm(n = n, b0 = b0, X = X, B = B, Sigma = Sigma, probl = 0.05, probr = 0.5, 
           probna = 0.05)
out <- cglasso(. ~ ., data = Z)
out.mle <- cggm(out, lambda.id = 3L, rho.id = 3L)
plot(out.mle, type = "Gyy")
plot(out.mle, type = "Gxy")
plot(out.mle, type = "both")

cglasso documentation built on Jan. 17, 2023, 5:10 p.m.