R: Conduct MCMC diagnostics on an ERGMM fit

mcmc.diagnostics.ergmm {latentnet} | R Documentation

## 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 class '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.

### Details

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

### Value

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

### See Also

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

### Examples

    #
    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)

[Package latentnet version 2.10.5 Index]