Learn R Programming

PNAR (version 1.7)

adja_gnp: Generation of a network from the Erdos-Renyi model

Description

This function generates a network from the Erdos-Renyi model.

Usage

adja_gnp(N, alpha, directed = FALSE)

Value

A row-normalized non-negative matrix describing the network. The main diagonal entries of the matrix are zeros, all the other entries are non-negative and the maximum sum of elements over the rows equals one.

Arguments

N

The number of nodes on the network.

alpha

The network density. A value in \([0,1]\) defining the frequency of connections in the network.

directed

Logical scalar, whether to generate a directed network. If TRUE a directed network is generated.

Author

Mirko Armillotta, Michail Tsagris and Konstantinos Fokianos.

Details

For each pair of nodes it performs a Bernoulli trial with values 1 "draw an edge", 0 "otherwise". Each trial has the same probability of having an edge; this is equal to \(\alpha*N^{-0.3}\), specified based on the number of nodes on the network \(N\) and the network density alpha.

References

Erdos, P. and A. Renyi (1959). On random graphs. Publicationes Mathematicae, 6, 290--297.

See Also

adja

Examples

Run this code
W <- adja_gnp(N = 20, alpha= 0.1)

Run the code above in your browser using DataLab