Learn R Programming

Bergm (version 4.2.0)

calibrate.bergm: Calibrating misspecified Bayesian ERGMs

Description

Function to transform a sample from the pseudo-posterior to one that is approximately sampled from the intractable posterior distribution.

Usage

calibrate.bergm(formula, iters = 500, a = 0.001, alpha = 0,
  aux.iters = 5000, noisy.nsim = 400, noisy.thin = 50,
  prior.mean = NULL, prior.sigma = NULL, thin = 1, mcmc = 40000,
  burnin = 10000, tunePL = 1)

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.

iters

count; Iterations for the Robbins-Monro stochastic approximation algorithm.

a

scalar; Constant for sequence alpha_n (Robbins-Monro).

alpha

scalar; Noise added to gradient (Robbins-Monro).

aux.iters

count; Number of proposals before any MCMC sampling is done (Robbins-Monro). See control.simulate.formula.

noisy.nsim

count; Number of TNT draws (Robbins-Monro). See control.simulate.formula.

noisy.thin

count; Number of proposals between sampled statistics (Robbins-Monro). See control.simulate.formula.

prior.mean

vector; Prior means.

prior.sigma

matrix; Prior covariance matrix.

thin

count; Thinning interval used in the simulation for the pseudo-posterior estimation. The number of MCMC iterations must be divisible by this value.

mcmc

count; Number of MCMC iterations after burn-in for the pseudo-posterior estimation.

burnin

count; Number of burn-in iterations at the beginning of an MCMC run for the pseudo-posterior estimation.

tunePL

count; Tuning parameter for the Metropolis sampling for the pseudo-posterior estimation.

References

Bouranis, L., Friel, N., & Maire, F. (2017). Efficient Bayesian inference for exponential random graph models by correcting the pseudo-posterior distribution. Social Networks, 50, 98-108.https://arxiv.org/abs/1510.00934

Examples

Run this code
# NOT RUN {
# Load the florentine marriage network
data(florentine)
                                 
# Calibrated pseudo-posterior:

cpp.flo <- calibrate.bergm(flomarriage ~ edges + kstar(2),
                           aux.iters = 3000,
                           mcmc = 10000,  
                           burnin = 500,
                           tunePL = 2.5)
                                                   
# MCMC diagnostics and posterior summaries:

bergm.output(cpp.flo)

# Bayesian goodness-of-fit test:

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

Run the code above in your browser using DataLab