View source: R/simulate.mmsbm.R
simulate.mmsbm | R Documentation |
mmsbm
objectThe function generates one sample network from the posterior predictive of the model represented by a fitted mmsbm
object.
## S3 method for class 'mmsbm'
simulate(
object,
nsim = 1,
seed = NULL,
new.data.dyad = NULL,
new.data.monad = NULL,
...
)
object |
An object of class |
nsim |
Number of networks to simulate |
seed |
RNG seed. |
new.data.dyad |
An optional |
new.data.monad |
An optional |
... |
Currently ignored |
List of length nsim
of simulated networks.
If new.data.dyad = NULL
, each element is a vector of length nrow(object$dyadic.data)
.
Else, vector of length nrow(new.data.dyad)
. If seed
is not NULL, return object
includes its value as attribute "seed".
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
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))
## Simulate 5 new networks
lazega_sim <- simulate(lazega_mmsbm, nsim = 5, seed = 123)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.