# load the Florentine marriage network
# included with the ergm package
data(florentine)
# Estimation of a 3-dimensional model
# measuring the propensity to form 2- and 3- stars.
# PopMCMC with parallel ADS approach is used
# (this will take about 6 minutes)
flo <- bergm(flomarriage~edges+kstar(2:3),
burn.in=500,aux.iter=3000,main.iter=5000,
sdprior=c(5,5),gamma=0.6,sdepsilon=0.1)
# MCMC diagnostics for the second chain
# and overall poterior estimate
diagnostics <- mcmc.output(flo,lags=300,chain=2)
# Posterior density scatterplots
# and covariance matrix
posterior.plot(diagnostics)
# Bayesian goodness-of-fit test
bgof(flo,lags=200,n.sim=100,n.deg=10,n.dist=9,n.esp=6)
Run the code above in your browser using DataLab