mmsbm {NetMix} | R Documentation |
Dynamic mixed-membership stochastic blockmodel with covariates
Description
The function estimates a dynamic mixed-membership stochastic blockmodel that incorporates covariates.
Usage
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()
)
Arguments
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.
|
Value
Object of class mmsbm
. List with named components:
- MixedMembership
Matrix of variational posterior of mean of mixed-membership vectors.
nodes
byn.blocks
.- BlockModel
n.blocks
byn.blocks
matrix of estimated tie log-odds between members of corresponding latent groups. The blockmodel.- vcov_blockmodel
If
hessian=TRUE
, variance-covariance matrix of parameters in blockmodel, ordered in column-major order.- MonadCoef
Array of estimated coefficient values for monadic covariates. Has
n.blocks
columns, andn.hmmstates
slices.- vcov_monad
If
hessian=TRUE
, variance-covariance matrix of monadic coefficients.- DyadCoef
Vector estimated coefficient values for dyadic covariates.
- vcov_dyad
If
hessian=TRUE
, variance-covariance matrix of dyadic coefficients.- TransitionKernel
Matrix of estimated HMM transition probabilities.
- Kappa
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).- LowerBound
Final LB value
- lb
Vector of all LB across iterations, useful to check early convergence issues.
- niter
Final number of VI iterations.
- converged
Convergence indicator; zero indicates failure to converge.
- NodeIndex
Order in which nodes are stored in all return objects.
- monadic.data, dyadic.data
Model frames used during estimation (stripped of attributes).
- forms
Values of selected formal arguments used by other methods.
- seed
The value of RNG seed used during estimation.
- call
Original (unevaluated) function call.
Author(s)
Santiago Olivella (olivella@unc.edu), Adeline Lo (aylo@wisc.edu), Tyler Pratt (tyler.pratt@yale.edu), Kosuke Imai (imai@harvard.edu)
Examples
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))