rbernoulli {ergmito}R Documentation

Random Bernoulli graph

Description

Random Bernoulli graph

Usage

rbernoulli(n, p = 0.5)

Arguments

n

Integer vector. Size of the graph. If length(n) > 1, then it will a list of random graphs.

p

Probability of a tie. This may be either a scalar, or a vector of the same length of n.

Value

If n is a single number, a square matrix of size n with zeros in the diagonal. Otherwise it returns a list of length(n) square matrices of sizes equal to those specified in n.

Examples

# A graph of size 4
rbernoulli(4)

# 3 graphs of various sizes
rbernoulli(c(3, 4, 2))

# 3 graphs of various sizes and different probabilities
rbernoulli(c(3, 4, 6), c(.1, .2, .3))

[Package ergmito version 0.3-1 Index]