simulateGraph: Generate sparse Gaussian Graphical Models

View source: R/simulateGraph.R

simulateGraphR Documentation

Generate sparse Gaussian Graphical Models

Description

Generate random covariance matrices C with sparse inverse. The Gaussian law N(0,C) is then a sparse (non-uniform) Gaussian Graphical Model.

Usage

simulateGraph(p, eta, extraeta = eta/5)

Arguments

p

integer. Number of rows and columns of C. Should be greater than 1.

eta

real number in (0,1). Proportion of edges in subgroups. Small values of eta give sparse graphs.

extraeta

real number in (0,1). Proportion of edges inter groups.

Details

More details are available on ../doc/Notice.pdf

Value

G

p x p matrix. Adjacency matrix of the graph.

Dmax

integer. Maximum degree of the graph.

Neighb

array of dimension p x Dmax. Neighb[a, ] contains the indices of the nodes connected to node a.

Nnodes

integer. Number of nodes.

C

p x p matrix. Covariance matrix.

PCor

p x p matrix. Partial correlation matrix.

Author(s)

Bouvier A, Giraud C, Huet S, Verzelen N

References

Please use citation("GGMselect").

See Also

selectQE, selectMyFam, selectFast, penalty, convertGraph

Examples

# simulate a graph
p=30
eta=0.13
Gr <- simulateGraph(p,eta)

# plot the graph
library(network)
par(mfrow=c(1,1))
gV <- network(Gr$G)
plot(gV,jitter=TRUE, usearrows = FALSE, label=1:p,displaylabels=TRUE)

GGMselect documentation built on Aug. 31, 2023, 5:06 p.m.