ergm_block_diag_samp_info {ergm.multi} | R Documentation |
Compute and serialize information needed by the block-diagonal Metropolis-Hastings samplers.
Description
Given a nodal attribute vector specifying the blocks returns a list containing information needed to efficiently sample dyads in those blocks.
Usage
ergm_block_diag_samp_info(nw, a)
Arguments
nw |
the network of interest. |
a |
either a vector (of any mode) whose |
Value
An object of nonce class ergm_block_diag_samp_info
with
the following elements at this time:
nblk
number of blocks
pos
(for unipartite),b1pos
andb2pos
(for bipartite)vectors of length
nblk+1
such that(pos[i]+1):(pos[i+1])
are the numbers of the vertices in blocki
.cumwt
vector of length
nblk
with values such that generatingU\sim \mathrm{Uniform}(0,1)
selecting the index of the first element incumwt
that is greater thanU
will sample from the blocks in proportion to the number of dyads in the block.
In addition, an attribute "ndyads"
is attached, containing the
total number of dyads in all blocks put together.