Learn R Programming

HyperG (version 1.0.0)

sample_gnp_hypergraph: Erdos-Renyi hypergraphs.

Description

Sample an Erdos-Renyi p hypergraph.

Usage

sample_gnp_hypergraph(n, m, p, lambda)

Arguments

n

number of nodes.

m,lambda

controls the number of hyper-edges. If m is not given, the number is drawn from a Poisson(lambda), or, a Poisson(n*p) if lambda is not given.

p

Hyper-edge probability.

Value

a hypergraph.

Details

This generates an ER hypergraph by using rbinom to generate a random mxn matrix of Bernoulli random variables and treating this matrix as the incidence matrix for the hypergraph. If m is not given, and lambda is, then m is drawn from a Poisson distribution with parameter lambda. If neither is given, the number of hyper-edges is drawn from a Poisson distribution with parameter n*p.

See Also

rbinom, rpois.

Examples

Run this code
# NOT RUN {
	set.seed(672)
   h <- sample_gnp_hypergraph(n=100,p=.1)
# }

Run the code above in your browser using DataLab