View source: R/cggm_S3methods.R
plot.cggm | R Documentation |
cggm
’ ObjectThe plot.cggm
produces graphs from an R object of class ‘cggm
’.
## S3 method for class 'cggm'
plot(x, type, weighted = FALSE, simplify = TRUE, ...)
x |
an R object of class ‘ |
type |
a description of the required graph. Default depends on the type of fitted model, that is, |
weighted |
logical. Should weighted graphs be created? Default is |
simplify |
logical. Should isolated vertices be removed from the graph? Default is |
... |
additional graphical arguments passed to the functions |
Luigi Augugliaro (luigi.augugliaro@unipa.it)
cggm
, to_graph
, getGraph
and plot.cglasso2igraph
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.