Learn R Programming

Bergm (version 1.0)

bergm: Bayesian exponential random graph models

Description

Function to fit Bayesian exponential random graphs models using the exchange algorithm with either single-site update or population MCMC with snooker update.

Usage

bergm(model, burn.in = 1000, main.iter = 25000, sdprop = NULL, sdprior = 50, mprior = 0, theta = NULL, popMCMC = FALSE, nchains = NULL, block.iter = 1000, sdblock = NULL, sdgamma = 0.5, sdepsilon = 0.05, save = FALSE)

Arguments

model
formula; ~
burn.in
count; number of auxiliary iterations
main.iter
count; number of iterations for the main chain(s)
sdprop
vector; standard deviation for the (Normal) proposal distribution
sdprior
vector; standard deviation for the (Normal) prior distribution
mprior
vector; mean for the (Normal) prior distribution
theta
vector; initial parameter value
popMCMC
logical; If TRUE, population MCMC is performed using snooker update
nchains
count; number of chains for population MCMC
block.iter
count; number of iterations for the block update used at the start of population MCMC procedure
sdblock
vector; standard deviation for the block update proposal
sdgamma
vector; standard deviation for the first snooker update parameter (gamma)
sdepsilon
vector; standard deviation for the second snooker update parameter (epsilon)
save
logical; if TRUE a file called "bergm.out" is saved in the working directory

Value

  • thetamatrix containing all the parameter values estimated
  • dimmodel dimensions
  • chainsnumber of chains
  • iternumber of iterations for the main chain(s)
  • rateacceptance rate(s)
  • modmodel

References

Caimo, A. and Friel, N. (2009) ``Bayesian inference for exponential random graph models,'' (submitted).

Murray, I., Ghahramani, Z., and MacKay, D. (2006), ``MCMC for doubly-intractable distributions,'' in Proceedings of the 22nd Annual Conference on Uncertainty in Artificial Intelligence (UAI-06), Arlington, Virginia: AUAI Press.

Handcock, M. S., Hunter, D. R., Butts, C. T., Goodreau, S. M., and Morris, M. (2007), ``statnet: Software tools for the representation, visualization, analysis and simulation of network data,'' Journal of Statistical Software, 24,1-11.

Hunter, D. R., Handcock, M. S., Butts, C. T., Goodreau, S. M., and Morris M. (2008), ``ergm: A Package to Fit, Simulate and Diagnose Exponential-Family Models for Networks'', 24, 1-29.

Examples

Run this code
data(florentine)

# Bayesian estimation via exchange algorithm
# (population MCMC with snooker update)

flo2 <- bergm(flobusiness~edges+kstar(2),main.iter=10000,           popMCMC=TRUE,sdprior=50,block.iter=1000,sdgamma=1)

Run the code above in your browser using DataLab