dynamic.DCSBM: dynamic.DCSBM

Description Usage Arguments Value Author(s) References Examples

View source: R/dynamic_DCSBM.R

Description

Simulate an ordered sequence of undirected graphs from the degree corrected stochastic block random graph model. Edge weights are discrete valued and are generated independently where e_ij ~ Poisson(theta_i*theta_j*P_c_i, c_j)

Usage

1
2
dynamic.DCSBM(n, T, P.array, community.array, delta.array,
  edge.list = c(FALSE, TRUE))

Arguments

n:

number of nodes in the graph

T:

number of graphs in the temporal sequence

P.array:

an array of length T whose tth entry is the matrix of probabilities for network t

community.array:

an array of length T whose tth entry is a numeric vector of length n specifying community labels at time t

delta.array:

an array of length T whose tth entry is a numeric vector of length k whose values must be between 0 and 1.

edge.list:

a logical that specifies whether or not the adjacency matrix should be returned as an edge list.

Value

a list containing the objects

Author(s)

James D. Wilson and Nathaniel T. Stevens

References

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#Generate a collection of 50 networks with a change at time 25. The change is a local 
#change in connection propensity in community 1
n <- 100
P.old <- cbind(c(0.10, 0.01), c(0.02, 0.075))
P.new <- cbind(c(0.20, 0.025), c(0.02, 0.075))
P.array <- array(c(replicate(25, P.old), replicate(25, P.new)), dim = c(2, 2, 50))
community.array <- array(rep(c(rep(1, 50), rep(2, 50)), 50), dim = c(1, 100, 50))
delta.array <- array(rep(rep(0.2, 2), 50), dim = c(1, 2, 50))

dynamic.net <- dynamic.DCSBM(n = 100, T = 50, P.array = P.array,
                             community.array = community.array,
                             delta.array = delta.array, edge.list = FALSE)
image(Matrix(dynamic.net$Adjacency.list[[1]]))
image(Matrix(dynamic.net$Adjacency.list[[30]]))

jdwilson4/NetSurv documentation built on May 18, 2019, 11:40 p.m.