| selectMyFam | R Documentation |
Select a graph within a given family of graphs.
selectMyFam(X, MyFamily, K=2.5, min.ev=10**(-8))
X |
|
MyFamily |
list of pxp adjacency matrices corresponding to
graphs with degree less or equal to |
K |
scalar or vector with values larger than 1. Tuning parameter of the penalty function. |
min.ev |
minimum eigenvalue for matrix inversion. |
More details are available on ../doc/Notice.pdf
Neighb |
array of dimension |
crit.min |
vector of dimension |
ind.min |
vector of dimension |
G |
array of dimension |
Adjacency matrices can be generated from lists of connected nodes
by using the function convertGraph
Bouvier A, Giraud C, Huet S, Verzelen N.
Please use citation("GGMselect").
selectFast, selectQE,
simulateGraph, penalty,
convertGraph
p=30
n=30
# generate graph
eta=0.11
Gr <- simulateGraph(p,eta)
# generate data
X <- rmvnorm(n, mean=rep(0,p), sigma=Gr$C)
# generate a family of candidate graphs with glasso
library("glasso")
MyFamily <- NULL
for (j in 1:3){
MyFamily[[j]] <- abs(sign(glasso(cov(X),rho=j/5)$wi))
diag(MyFamily[[j]]) <- 0
}
# select a graph within MyFamily
GMF <- selectMyFam(X,MyFamily)
# plot the result
library(network)
par(mfrow=c(1,2))
gV <- network(Gr$G)
plot(gV,jitter=TRUE, usearrows = FALSE, label=1:p,displaylabels=TRUE)
gMyFam <- network(GMF$G)
plot(gMyFam, jitter=TRUE, usearrows = FALSE, label=1:p,displaylabels=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.