generate_2networks: Generate sparse invcov with overlap

Description Usage Arguments Value Examples

View source: R/netsim.R

Description

Generate two sparse inverse covariance matrices with overlap

Usage

1
2
3
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

nethet documentation built on Nov. 8, 2020, 6:54 p.m.