Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bergmC

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

bergmC(
  formula,
  prior.mean = NULL,
  prior.sigma = NULL,
  burn.in = 10000,
  main.iters = 40000,
  aux.iters = 3000,
  V.proposal = 1.5,
  thin = 1,
  rm.iters = 500,
  rm.a = 0.001,
  rm.alpha = 0,
  n.aux.draws = 400,
  aux.thin = 50,
  estimate = c("MLE", "CD"),
  seed = 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.

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.

burn.in

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

main.iters

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

aux.iters

count; number of auxiliary iterations used for drawing the first network from the ERGM likelihood (Robbins-Monro). See control.simulate.formula.

V.proposal

count; diagonal entry for the multivariate Normal proposal. By default set to 1.5.

thin

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

rm.iters

count; number of iterations for the Robbins-Monro stochastic approximation algorithm.

rm.a

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

rm.alpha

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

n.aux.draws

count; number of auxiliary networks drawn from the ERGM likelihood (Robbins-Monro). See control.simulate.formula.

aux.thin

count; number of auxiliary iterations between network draws after the first network is drawn (Robbins-Monro). See control.simulate.formula.

estimate

If "MLE" (the default), then an approximate maximum likelihood estimator is used as a starting point in the Robbins-Monro algorithm. If "CD" , the Monte-Carlo contrastive divergence estimate is returned. See ergm.

seed

integer; seed for the random number generator. See set.seed.

...

Additional arguments, to be passed to the ergm function. See ergm.

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

## Not run: 
# Load the florentine marriage network
data(florentine)
                                 
# Calibrated pseudo-posterior:
cpp.flo <- bergmC(flomarriage ~ edges + kstar(2),
                  aux.iters  = 500,
                  burn.in    = 500,
                  main.iters = 10000,
                  V.proposal = 2.5)

# Posterior summaries:
summary(cpp.flo)

## End(Not run)

Bergm

Bayesian Exponential Random Graph Models

v5.0.2
GPL (>= 2)
Authors
Alberto Caimo [aut, cre], Lampros Bouranis [aut], Robert Krause [aut] Nial Friel [ctb]
Initial release
2020-11-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.