Learn R Programming

ergm (version 2.4-2)

san: Use Simulated Annealing to attempt to match a network to a vector of mean statistics

Description

This function attempts to find a network or networks whose statistics match those passed in via the meanstats vector.

Usage

## S3 method for class 'formula':
san(object, nsim=1, seed=NULL, theta0=NULL,
                      tau=1, invcov=NULL,
                      burnin=10000, interval=10000,
                      meanstats=NULL,
                      basis=NULL,
                      sequential=TRUE,
                      constraints = ~.,
                      control = control.san(),
                      verbose=FALSE, ...)
## S3 method for class 'ergm':
san(object, nsim=1, seed=NULL, theta0=object$coef,
                      burnin=10000, interval=10000, 
                      meanstats=NULL,
                      basis=NULL,
                      sequential=TRUE,
                      constraints = NULL,
                      control = control.san(),
                      verbose=FALSE, ...)

Arguments

object
an Robject. Either a formula or an ergm object. The formula should be of the form y ~
nsim
Number of desired networks.
seed
Random number integer seed.
theta0
Parameter values used for MCMC simulations.
tau
Currently unused.
invcov
Initial inverse covariance matrix used to calculate Mahalanobis distance in determining how far a proposed MCMC move is from the meanstats vector. If NULL, taken to be the covariance matrix returned when fitting the MPLE (if
burnin
Number of MCMC steps prior to recording first vector of network statistics.
interval
Number of MCMC steps between recordings of network statistics
meanstats
A vector of the same length as the number of terms implied by the formula, which is either object itself in the case of san.formula or object$formula in the case of san.ergm.
basis
If not NULL, a network that forms the beginning of the Markov chain. If NULL, this is taken to be the network named in the formula.
sequential
Logical: Should the returned draws use the prior draw as the starting network or always use the initially passed network?
constraints
A one-sided formula specifying one or more constraints on the support of the distribution of the networks being simulated. See the documentation for a similar argument for ergm for more information
control
A list of control parameters for algorithm tuning. Constructed using control.san.
verbose
If this is TRUE, we will print out more information as we run the program, including (currently) some goodness of fit statistics.
...
Further arguments passed to or used by methods.

Value

  • A network or list of networks that hopefully have network statistics close to the meanstats vector.