Learn R Programming

Bergm (version 1.0)

bgof: Bayesian goodness-of-fit diagnostics

Description

Calculates summaries for degree, minimum geodesic distances, and edge-wise shared partner distributions to diagnose the Bayesian goodness-of-fit of exponential family random graph models.

Usage

bgof(out, directed = FALSE, lag = 100, n.sim = NULL, burn.in = 10000, n.deg = NULL, n.dist = NULL, n.esp = NULL, n.ideg = NULL, n.odeg = NULL, save = FALSE)

Arguments

out
bergm output
directed
logical; TRUE if the observed graph is directed
lag
count; interval between each sampled posterior parameter estimate
n.sim
count; number of sampled parameter values
burn.in
count; number of iterations used for each graph simulation
n.deg
count; used to plot only the first n.deg-1 degree distributions
n.dist
count; used to plot only the first n.dist-1 geodesic distances distributions
n.esp
count; used to plot only the first n.esp-1 edge-wise shared partner distributions
n.ideg
count; used to plot only the first n.ideg-1 in-degree distributions
n.odeg
count; used to plot only the first n.odeg-1 out-degree distributions
save
logical; if TRUE a file called "bgof.out" is saved in the working directory

Examples

Run this code
data(florentine)

flo1 <- bergm(flobusiness~edges+kstar(2),main.iter=15000,
sdprop=c(1,0.1),sdprior=20,theta=c(-2,0.1))

## Bayesian goodness-of-fit test 

bgof(flo1,lag=150,n.sim=100)

## Let's improve the plots

bgof(flo1,lag=150,n.sim=100,n.deg=10,n.dist=9,n.esp=6)

Run the code above in your browser using DataLab