View source: R/undirected_planted_partition.R
planted_partition | R Documentation |
To specify a planted partition model, you must specify
the number of nodes (via n
), the mixing matrix (optional, either via
within_block/between_block
or a/b
),
and the relative block probabilites (optional, via pi
).
We provide defaults for most of these options to enable
rapid exploration, or you can invest the effort
for more control over the model parameters. We strongly recommend
setting the expected_degree
or expected_density
argument
to avoid large memory allocations associated with
sampling large, dense graphs.
planted_partition(
n,
k,
...,
within_block = NULL,
between_block = NULL,
a = NULL,
b = NULL,
pi = rep(1/k, k),
sort_nodes = TRUE,
poisson_edges = TRUE,
allow_self_loops = TRUE
)
n |
The number of nodes in the network. Must be a positive integer. This argument is required. |
k |
Number of planted partitions, as a positive integer. This argument is required. |
... |
Arguments passed on to
|
within_block |
Probability of within block edges. Must be
strictly between zero and one. Must specify either
|
between_block |
Probability of between block edges. Must be
strictly between zero and one. Must specify either
|
a |
Integer such that |
b |
Integer such that |
pi |
(relative block probabilities) Relative block
probabilities. Must be positive, but do not need to sum
to one, as they will be normalized internally.
Must match the dimensions of |
sort_nodes |
Logical indicating whether or not to sort the nodes
so that they are grouped by block and by |
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 |
A planted partition model is stochastic blockmodel in which
the diagonal and the off-diagonal of the mixing matrix B
are both constant. This means that edge probabilities
depend only on whether two nodes belong to the same block,
or to different blocks, but the particular blocks themselves
don't have any impact apart from this.
An undirected_planted_partition
S3 object, which is a subclass
of the sbm()
object, with additional fields:
within_block
: The probability of edge formation within a block.
between_block
: The probability of edge formation between two distinct
blocks.
Other stochastic block models:
dcsbm()
,
directed_dcsbm()
,
mmsbm()
,
overlapping_sbm()
,
sbm()
Other undirected graphs:
chung_lu()
,
dcsbm()
,
erdos_renyi()
,
mmsbm()
,
overlapping_sbm()
,
sbm()
set.seed(27)
lazy_pp <- planted_partition(
n = 1000,
k = 5,
expected_density = 0.01,
within_block = 0.1,
between_block = 0.01
)
lazy_pp
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.