mmsbm | R Documentation |
The function estimates a dynamic mixed-membership stochastic blockmodel that incorporates covariates.
mmsbm(
formula.dyad,
formula.monad = ~1,
senderID,
receiverID,
nodeID = NULL,
timeID = NULL,
data.dyad,
data.monad = NULL,
n.blocks,
n.hmmstates = 1,
directed = TRUE,
mmsbm.control = list()
)
formula.dyad |
A |
formula.monad |
An optional |
senderID |
Character string. Quoted name of the variable in |
receiverID |
Character string. Quoted name of the variable in |
nodeID |
Character string. Quoted name of the variable in |
timeID |
Character string. Quoted name of the variable in both |
data.dyad |
Data frame. Sociomatrix in “long” (i.e. dyadic) format. Must contain at least three variables: the sender identifier (or identifier of the first node in an undirected networks dyad), the receiver identifier (or identifier of the second node in an undirected network dyad), and the value of the edge between them. Currently, only edges between zero and one (inclusive) are supported. |
data.monad |
Data frame. Nodal atributes. Must contain a node identifier matching the names of nodes
used in the |
n.blocks |
Integer value. How many latent groups should be used to estimate the model? |
n.hmmstates |
Integer value. How many hidden Markov state should be used in the HMM? Defaults to 1 (i.e. no HMM). |
directed |
Boolean. Is the network directed? Defaults to |
mmsbm.control |
A named list of optional algorithm control parameters.
|
Object of class mmsbm
. List with named components:
Matrix of variational posterior of mean of mixed-membership vectors. nodes
by
n.blocks
.
n.blocks
by n.blocks
matrix of estimated tie log-odds between members
of corresponding latent groups. The blockmodel.
If hessian=TRUE
, variance-covariance matrix of parameters in blockmodel, ordered in column-major order.
Array of estimated coefficient values for monadic covariates. Has n.blocks
columns,
and n.hmmstates
slices.
If hessian=TRUE
, variance-covariance matrix of monadic coefficients.
Vector estimated coefficient values for dyadic covariates.
If hessian=TRUE
, variance-covariance matrix of dyadic coefficients.
Matrix of estimated HMM transition probabilities.
Matrix of marginal probabilities of being in an HMM state at any given point in time.
n.hmmstates
by years (or whatever time interval networks are observed at).
Final LB value
Vector of all LB across iterations, useful to check early convergence issues.
Final number of VI iterations.
Convergence indicator; zero indicates failure to converge.
Order in which nodes are stored in all return objects.
Model frames used during estimation (stripped of attributes).
Values of selected formal arguments used by other methods.
The value of RNG seed used during estimation.
Original (unevaluated) function call.
Santiago Olivella (olivella@unc.edu), Adeline Lo (aylo@wisc.edu), Tyler Pratt (tyler.pratt@yale.edu), Kosuke Imai (imai@harvard.edu)
library(NetMix)
## Load datasets
data("lazega_dyadic")
data("lazega_monadic")
## Estimate model with 2 groups
## Setting to `hessian=TRUE` increases computation time
## but is needed if standard errors are to be computed.
lazega_mmsbm <- mmsbm(SocializeWith ~ Coworkers,
~ School + Practice + Status,
senderID = "Lawyer1",
receiverID = "Lawyer2",
nodeID = "Lawyer",
data.dyad = lazega_dyadic,
data.monad = lazega_monadic,
n.blocks = 2,
mmsbm.control = list(seed = 123,
conv_tol = 1e-2,
hessian = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.