Learn R Programming

nethet (version 1.4.2)

generate_2networks: Generate sparse invcov with overlap

Description

Generate two sparse inverse covariance matrices with overlap

Usage

generate_2networks(p, graph = "random", n.nz = rep(p, 2), n.nz.common = p,
  n.hub = 2, n.hub.diff = 1, magn.nz.diff = 0.8, magn.nz.common = 0.9,
  magn.diag = 0, emin = 0.1, verbose = FALSE)

Arguments

p
number of nodes
graph
'random' or 'hub'
n.nz
number of edges per graph (only for graph='random')
n.nz.common
number of edges incommon between graphs (only for graph='random')
n.hub
number of hubs (only for graph='hub')
n.hub.diff
number of different hubs
magn.nz.diff
default=0.9
magn.nz.common
default=0.9
magn.diag
default=0
emin
default=0.1 (see ?huge.generator)
verbose
If verbose=FALSE then tracing output is disabled.

Value

  • Two sparse inverse covariance matrices with overlap

Examples

Run this code
n <- 70
p <- 30

## Specifiy sparse inverse covariance matrices,
## with number of edges in common equal to ~ 0.8*p
gen.net <- generate_2networks(p,graph='random',n.nz=rep(p,2),
                              n.nz.common=ceiling(p*0.8))

invcov1 <- gen.net[[1]]
invcov2 <- gen.net[[2]]

plot_2networks(invcov1,invcov2,label.pos=0,label.cex=0.7)

Run the code above in your browser using DataLab