undirected_factor_model {fastRG} | R Documentation |
Create an undirected factor model graph
Description
An undirected factor model graph is an undirected
generalized Poisson random dot product graph. The edges
in this graph are assumed to be independent and Poisson
distributed. The graph is parameterized by its expected
adjacency matrix, which is E[A|X] = X S X'
. We do not recommend
that casual users use this function, see instead dcsbm()
and related functions, which will formulate common variants
of the stochastic blockmodels as undirected factor models
with lots of helpful input validation.
Usage
undirected_factor_model(
X,
S,
...,
expected_degree = NULL,
expected_density = NULL,
poisson_edges = TRUE,
allow_self_loops = TRUE
)
Arguments
X |
A |
S |
A |
... |
Ignored. Must be empty. |
expected_degree |
If specified, the desired expected degree
of the graph. Specifying |
expected_density |
If specified, the desired expected density
of the graph. Specifying |
poisson_edges |
Logical indicating whether or not
multiple edges are allowed to form between a pair of
nodes. Defaults to |
allow_self_loops |
Logical indicating whether or not
nodes should be allowed to form edges with themselves.
Defaults to |
Value
An undirected_factor_model
S3 class based on a list
with the following elements:
-
X
: The latent positions as aMatrix()
object. -
S
: The mixing matrix as aMatrix()
object. -
n
: The number of nodes in the network. -
k
: The rank of expectation matrix. Equivalently, the dimension of the latent node position vectors.
Examples
n <- 10000
k <- 5
X <- matrix(rpois(n = n * k, 1), nrow = n)
S <- matrix(runif(n = k * k, 0, .1), nrow = k)
ufm <- undirected_factor_model(X, S)
ufm
ufm2 <- undirected_factor_model(X, S, expected_degree = 50)
ufm2
svds(ufm2)