Skip to contents

A collection of functions to generate random graphs with specified edge distribution.

Usage

rpois_network(n, num_vertices, lambda = 1)

rexp_network(n, num_vertices, rate = 1)

rbinom_network(n, num_vertices, size = 1, prob = 0.5)

rsbm(n, num_vertices, pref_matrix, block_sizes)

Arguments

n

Sample size.

num_vertices

Number of vertices.

lambda

The mean parameter for the Poisson distribution (default: 1).

rate

The rate parameter for the exponential distribution (default: 1).

size

The number of trials for the binomial distribution (default: 1).

prob

The probability of success on each trial for the binomial distribution (default: 0.5).

pref_matrix

The matrix giving the Bernoulli rates. This is a KxK matrix, where K is the number of groups. The probability of creating an edge between vertices from groups i and j is given by element (i,j). For undirected graphs, this matrix must be symmetric. See sample_sbm.

block_sizes

Numeric vector giving the number of vertices in each group. The sum of the vector must match the number of vertices. See sample_sbm.

Value

A object of class nvd containing the sample of graphs.

Examples

nvd <- rexp_network(10, 68)