View source: R/random_networks.R
ind_rand_matrix | R Documentation |
The function creates random matrices following a uniform probability over the space of networks having exactly m fixed number of edges (Moreno and Jennings, 1938; Rapoport, 1948; Solomonoff and Rapoport, 1951; Erdos and Renyi, 1959) or following a probability of the formation of the ties (Gilbert, 1959) assuming ties independency.
ind_rand_matrix(
n,
m = NULL,
type = c("edges", "probability"),
digraph = TRUE,
loops = FALSE,
l = NULL,
p = NULL,
trials = 1,
multilevel = FALSE
)
n |
The number of nodes of the first set |
m |
The number of nodes of a second set |
type |
The model assumes a fixed number of |
digraph |
Whether the matrix is symmetric or not |
loops |
Whether to expect nonzero elements in the diagonal of the matrix |
l |
The number of ties expected for the |
p |
The probability of the ties expected for the |
trials |
Whether to add counting numbers to the |
multilevel |
Whether to return a meta-matrix to represent a multilevel network |
The fixed model is often called the G(n,m) graph with 'n' nodes and 'm' edges, and the 'm' edges are chosen uniformly randomly from the set of all possible ties.
The probability model is known as the G(n,p) graph, in which the matrix has 'n' nodes, and for each tie, the probability that it is present in the matrix is 'p'.
These are the simplest models that follow a conditional uniform distribution that place nonnull probability on a subset of networks with distinctive characteristics corresponding to the observed networks - for example, simulating a matrix based on the number of ties observed in the network.
This function return the counts of the dyad census.
Alejandro Espinosa-Rada
Erdos, P. and Renyi, A. (1959). On random graphs. Publicationes Mathematicae 6, 290–297.
Gilbert, N. (1959). Random Graphs. The Annals of Mathematical Statistics, 30(4): 1141-1144.
Moreno, J. and Jennings, H. (1938). Statistics of social configurations. Sociometry, 1(3/4):342–374.
Rapoport, A. (1948). Cycle distributions in random nets. Bulletin of Mathematical Biology, 10(3):145–157.
Solomonoff, R. and Rapoport, A. (1951). Connectivity of random nets. Bulletin of Mathematical Biology, 13:107–117.
set.seed(18051889)
ind_rand_matrix(5, type = "edges", l = 3, digraph = TRUE, loops = TRUE)
ind_rand_matrix(5, type = "probability")
ind_rand_matrix(n = 5, m = 2, p = 0.20, type = "probability", multilevel = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.