Last data update: 2014.03.03

R: Generate sparse invcov with overlap
generate_2networksR Documentation

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

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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(nethet)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/nethet/generate_2networks.Rd_%03d_medium.png", width=480, height=480)
> ### Name: generate_2networks
> ### Title: Generate sparse invcov with overlap
> ### Aliases: generate_2networks
> 
> ### ** Examples
> 
> 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)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>