Learn R Programming

Bergm (version 4.2.0)

missBergm: Parameter estimation for Bayesian ERGMs under missing data

Description

Function to fit Bayesian exponential random graphs models under missing data using the approximate exchange algorithm.

Usage

missBergm(formula, burn.in = 100, main.iters = 1000,
  aux.iters = 1000, prior.mean = NULL, prior.sigma = NULL,
  nchains = NULL, gamma = 0.5, sigma.epsilon = NULL, seed = NULL,
  startVals = NULL, nImp = NULL, missingUpdate = NULL, ...)

Arguments

formula

formula; an ergm formula object, of the form <network> ~ <model terms> where <network> is a network object and <model terms> are ergm-terms.

burn.in

count; number of burn-in iterations at the beginning of an MCMC run. If nchains > 2, it refers to the number of burn-in iterations for every chain of the population.

main.iters

count; number of iterations for the MCMC chain(s) excluding burn-in. If nchains > 2, it refers to the number of iterations for every chain of the population.

aux.iters

count; number of auxiliary iterations used for network simulation.

prior.mean

vector; mean vector of the multivariate Normal prior. By default set to a vector of 0's.

prior.sigma

square matrix; variance/covariance matrix for the multivariate Normal prior. By default set to a diagonal matrix with every diagonal entry equal to 100.

nchains

count; number of chains of the population MCMC. By default set to twice the model dimension (number of model terms). If the model is one-dimensional, nchains = 1.

gamma

scalar; ``parallel ADS move factor''. If the model is one-dimensional, nchains = 1 and gamma = sigma.espilon and is used as the variance of the Normal proposal distribution.

sigma.epsilon

square matrix; variance/covariance matrix for the multivariate Normal proposal when nchains > 2. By default set to a diagonal matrix with every diagonal entry equal to 0.0025. If the model is one-dimensional, sigma.espilon = gamma and is used as the variance of the Normal proposal distribution.

seed

count; random number seed for the Bergm estimation.

startVals

numeric matrix; Starting values for the parameter estimation. startVals requires a matrix with parameters by number of chains. If nchains == NULL, nchains is equal to 2 * the number of parameters in the model.

nImp

count; number of imputed networks to be returned. If null, no imputed network will be returned.

missingUpdate

count; number of tie updates in each imputation step. By default equal to number of missing ties. Smaller numbers increase speed. Larger numbers lead to better sampling.

...

additional arguments, to be passed to lower-level functions.

References

Caimo, A. and Friel, N. (2011), "Bayesian Inference for Exponential Random Graph Models," Social Networks, 33(1), 41-55. http://arxiv.org/abs/1007.5192

Caimo, A. and Friel, N. (2014), "Bergm: Bayesian Exponential Random Graphs in R," Journal of Statistical Software, 61(2), 1-25. jstatsoft.org/v61/i02

Koskinen, J.H., Robins, G.L., Pattison, P.E. (2010), "Analysing exponential random graph (p-star) models with missing data using bayesian data augmentation," Statistical Methodology 7(3), 366-384

Krause, R.W., Huisman, M., Steglich, C., Snijders, T.A. (2018), "Missing network data a comparison of different imputation methods," Proceedings of the 2018 IEEE/ACM International Conference on Advances in Social Networks Analysis and Mining 2018

Examples

Run this code
# NOT RUN {
# Load the florentine marriage network
data(florentine)


# Create missing data
set.seed(22101992)

missNode <- sample(1:16,1)
flomarriage[missNode,] <- NA
flomarriage[,missNode] <- NA


# Posterior parameter estimation:
m.flo <- missBergm(flomarriage ~ edges + kstar(2),
               burn.in = 50,
               aux.iters = 500,
               main.iters = 500,
               gamma = 1,
               nImp = 5)

# Posterior summaries:

bergm.output(m.flo)

# Bayesian goodness-of-fit test:

bgof(m.flo,
     aux.iters = 500,
     sample.size = 50,
     n.deg = 10,
     n.dist = 9,
     n.esp = 6)
# }

Run the code above in your browser using DataLab