Learn R Programming

PNAR (version 1.7)

adja: Generation of a network from the Stochastic Block Model

Description

This function generates a network from the Stochastic Block Model with \(K\) blocks.

Usage

adja(N, K, 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 sum of elements over the rows equals one.

Arguments

N

The number of nodes on the network.

K

The number of blocks. Each block has dimension \(N/K\). \(K\) should be chosen such that \(N\) is divisible by \(K\).

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 or not. 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". The probabilities of these trials are bigger if the two nodes are in the same block, lower otherwise, and they are specified based on the number of nodes on the network \(N\) and network density \(alpha\): Probability to draw an edge for a pair of nodes in the same block: \(\alpha*N^{-0.3}\). Probability to draw an edge for a pair of nodes in different blocks: \(\alpha*N^{-1}\).

References

Faust, K. and S. Wasserman (1992). Blockmodels: Interpretation and evaluation. Social Networks, 14, 5--61.

See Also

adja_gnp

Examples

Run this code
W <- adja(N = 20, K = 5, alpha = 0.1)

Run the code above in your browser using DataLab