DCSBM: DCSBM

Description Usage Arguments Value Author(s) References Examples

View source: R/DCSBM.R

Description

Simulate an undirected graph realization 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
3
DCSBM(n, k = 2, P, sizes = c(round(n/2), n - round(n/2)),
  random.community.assignment = c(FALSE, TRUE), community.labels = NULL,
  delta = rep(0, k), edge.list = c(FALSE, TRUE))

Arguments

n:

number of nodes in the graph

k:

number of communities in the graph

P:

the k x k matrix of probabilities whose i,jth entry specifies the probability of connection between nodes in community i and community j

sizes:

a numeric vector of length k whose ith entry specifies the size of the ith community. The entries must add to n.

random.community.assignment:

a logical that specifies whether or not community labels are determined at random. Default is FALSE.

community.labels:

an integer vector of length n whose ith entry is the community label of the ith vertex. Default is NULL. If provided, community labels are no longer assigned.

delta:

a numeric vector of length k whose values must be between 0 and 1. Theta parameters for community r are generated as an iid sample from a U(0 + delta, 1 - delta) distribution

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
net <- DCSBM(n = 500, k = 2, P = cbind(c(0.10, 0.01), c(0.02, 0.075)),
             sizes = c(200, 300), random.community.assignment = FALSE,
             delta = c(0.2, 0.7), edge.list = FALSE)
image(Matrix(net$Adjacency))

jdwilson4/NetSurv documentation built on Aug. 18, 2017, 4:04 p.m.