Learn R Programming

latentnet (version 2.7.1)

mcmc.diagnostics.ergmm: Conduct MCMC diagnostics on an ERGMM fit

Description

This function creates simple diagnostic plots for the MCMC sampled statistics produced from a fit. It also prints the Raftery-Lewis diagnostics, indicates if they are sufficient, and suggests the run length required.

Usage

# S3 method for ergmm
mcmc.diagnostics(object,which.diags=c("cor","acf","trace","raftery"),
                                 burnin=FALSE,
                                 which.vars=NULL,
                                 vertex.i=c(1),…)

Arguments

object

An object of class ergmm.

which.diags

A list of diagnostics to produce. "cor" is the correlation matrix of the statistics, "acf" plots the autocorrelation functions, "trace" produces trace plots and density estimates, and "raftery" produces the Raftery-Lewis statistics.

burnin

If not FALSE, rather than perform diagnostics on the sampling run, performs them on the pilot run whose index is given.

which.vars

A named list mapping variable names to the indices to include. If given, overrides the defaults and all arguments that follow.

vertex.i

A numeric vector of vertices whose latent space coordinates and random effects to include.

Additional arguments. None are supported at the moment.

Value

mcmc.diagnostics.ergmm returns a table of Raftery-Lewis diagnostics.

Details

Produces the plots per which.diags. Autocorrelation function that is printed if "acf" is requested is for lags 0 and interval.

See Also

ergmm, ergmm.object, raftery.diag, autocorr, plot.mcmc.list

Examples

Run this code
# NOT RUN {
#
data(sampson)
#
# test the mcmc.diagnostics function
#
gest <- ergmm(samplike ~ euclidean(d=2),
              control=ergmm.control(burnin=1000,interval=5))
summary(gest)
#
# Plot the traces and densities
#
mcmc.diagnostics(gest)
# }

Run the code above in your browser using DataLab