Learn R Programming

ernm (version 1.0.4)

simulateStatistics: Simulate statistics

Description

Generates a MCMC chain for an ernm model and returns the sample statistics

Usage

simulateStatistics(
  formula,
  theta,
  nodeSamplingPercentage = 0.2,
  mcmcBurnIn = 10000,
  mcmcInterval = 100,
  mcmcSampleSize = 100,
  ignoreMnar = TRUE,
  modelArgs = list(modelClass = "Model"),
  ...
)

Value

a matrix of statistics

Arguments

formula

the model formula (see ernm-formula)

theta

model parameters

nodeSamplingPercentage

how often the nodes should be toggled

mcmcBurnIn

burn in

mcmcInterval

interval

mcmcSampleSize

sample size

ignoreMnar

ignore missing not at random offsets

modelArgs

additional arguments for the model, e.g. tapering parameters

...

additional arguments to createCppSampler

Examples

Run this code
if (FALSE) {
edge_list <- matrix(numeric(),ncol=2)
net <- new(UndirectedNet,edge_list,5)
net[["group"]] <- c("a","b","a","b","a")

# generate sample statistics from a simple ernm model with positive homophily
stats <- simulateStatistics(net ~ edges() + nodeCount("group") + homophily("group") | group,
  theta = c(0,0,2),
  mcmcBurnIn=10)
colMeans(stats)
}

Run the code above in your browser using DataLab