Learn R Programming

dnc (version 1.2)

simulate.dnc: Simulate DNC

Description

Use an existing dnc object to simulate new network data.

Usage

"simulate"(object,nsim=1,seed=NULL,...)

Arguments

object
A dnc class object
nsim
Integer. Number of simulations to perform.
seed
Optional numeric. If is.null(seed) is FALSE then seed is used in a call to set.seed before simulating the network data. The default, NULL, will not change the random generator state.
...
additional optional arguments.

Value

A n x n x T x nsim array.

Details

This function uses the posterior mean of the latent positions and model parameters to simulate new network data sets.

Examples

Run this code
    data(friendship)
    set.seed(123)
    dncObj <- dnc(friendship,M=4,p=3,method="Gibbs",
                  controls=list(nDraws=250,burnin=50,
                                MaxItStg2=25,epsilonStg2=1e-15))
  newSims = simulate(dncObj,10,123)

Run the code above in your browser using DataLab