Learn R Programming

ergm (version 2.4-2)

ergm.bridge.llr: A simple implementation of bridge sampling to evaluate log-likelihood-ratio between two ERGM configurations

Description

This function uses bridge sampling with geometric spacing to estimate the difference between the log-likelihoods of two parameter configurations for an ERGM via repeated calls to simulate.formula.ergm.

Usage

ergm.bridge.llr(object, from, to, nsteps = 20,
sample.size = 10000, burnin = 10000, basis = NULL, verbose = FALSE, llronly = FALSE, ...)

Arguments

object
A model formula. See ergm for details.
basis
verbose
How much information to print about the progress.
from
The initial parameter configuration.
to
The final parameter configuration.
nsteps
Number of geometric bridges to use.
sample.size
Total number of MCMC draws to use (to be divided up among the bridges, so each bridge gets sample.size/nsteps draws.
burnin
Total number of steps draws to discart for each bridge (to be divided up among the bridges, so each bridge after the first gets sample.size/sqrt(nsteps).
llronly
Whether only the estiamted log-ratio should be returned. (Defaults to FALSE.)
...
Further arguments to simulate.formula.ergm.

Value

  • If llronly=TRUE, returns the scalar log-likelihood-ratio. Otherwise, returns a list with the following components:
  • llrThe estimated log-ratio.
  • llrsThe estimated log-ratios for each of the nsteps bridges.
  • pathA numeric matrix with nsteps rows, with each row being the respective bridge's parameter configuration.
  • statsA numeric matrix with nsteps rows, with each row being the respective bridge's vector of simulated statistics.
  • Dtheta.DuThe gradient vector of the parameter values with respect to position of the bridge.

References

Hunter, D. R. and Handcock, M. S. (2006) Inference in curved exponential family models for networks, Journal of Computational and Graphical Statistics.

See Also

simulate.formula.ergm