Description Usage Arguments Value Author(s) References Examples
View source: R/dynamic_DCSBM.R
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)
1 2 | dynamic.DCSBM(n, T, P.array, community.array, delta.array,
edge.list = c(FALSE, TRUE))
|
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. |
a list containing the objects
Adjacency.list: a list of length T whose tth entry is the adjacency matrix (or edge list if edge.list == TRUE) of the tth generated network
Theta.list: a list of length T whose tth entry is an n x 1 vector with values of each theta for the tth network
James D. Wilson and Nathaniel T. Stevens
Wilson, James D., Stevens, Nathaniel T., and Woodall, William H. (2016). <e2><80><9c>Modeling and estimating change in temporal networks via a dynamic degree corrected stochastic block model.<e2><80><9d> arXiv Preprint: http://arxiv.org/abs/1605.04049
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]]))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.