Create an directed erdos renyi object
directed_erdos_renyi(
n,
...,
p = NULL,
poisson_edges = TRUE,
allow_self_loops = TRUE
)
A directed_factor_model
S3 class based on a list
with the following elements:
X
: The incoming latent positions as a Matrix()
object.
S
: The mixing matrix as a Matrix()
object.
Y
: The outgoing latent positions as a Matrix()
object.
n
: The number of nodes with incoming edges in the network.
k1
: The dimension of the latent node position vectors
encoding incoming latent communities (i.e. in X
).
d
: The number of nodes with outgoing edges in the network.
Does not need to match n
-- rectangular adjacency matrices
are supported.
k2
: The dimension of the latent node position vectors
encoding outgoing latent communities (i.e. in Y
).
poisson_edges
: Whether or not the graph is taken to be have
Poisson or Bernoulli edges, as indicated by a logical vector
of length 1.
allow_self_loops
: Whether or not self loops are allowed.
Number of nodes in graph.
Arguments passed on to directed_factor_model
expected_in_degree
If specified, the desired expected in degree
of the graph. Specifying expected_in_degree
simply rescales S
to achieve this. Defaults to NULL
. Specify only one of
expected_in_degree
, expected_out_degree
, and expected_density
.
expected_out_degree
If specified, the desired expected out degree
of the graph. Specifying expected_out_degree
simply rescales S
to achieve this. Defaults to NULL
. Specify only one of
expected_in_degree
, expected_out_degree
, and expected_density
.
Probability of an edge between any two nodes. You must specify
either p
, expected_in_degree
, or expected_out_degree
.
Logical indicating whether or not
multiple edges are allowed to form between a pair of
nodes. Defaults to TRUE
. When FALSE
, sampling proceeds
as usual, and duplicate edges are removed afterwards. Further,
when FALSE
, we assume that S
specifies a desired between-factor
connection probability, and back-transform this S
to the
appropriate Poisson intensity parameter to approximate Bernoulli
factor connection probabilities. See Section 2.3 of Rohe et al. (2017)
for some additional details.
Logical indicating whether or not
nodes should be allowed to form edges with themselves.
Defaults to TRUE
. When FALSE
, sampling proceeds allowing
self-loops, and these are then removed after the fact.
Other erdos renyi:
erdos_renyi()
Other directed graphs:
directed_dcsbm()
set.seed(87)
er <- directed_erdos_renyi(n = 10, p = 0.1)
er
big_er <- directed_erdos_renyi(n = 10^6, expected_in_degree = 5)
big_er
A <- sample_sparse(er)
A
Run the code above in your browser using DataLab