san {ergm}R Documentation

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 R object. Either a formula or an ergm object. The formula should be of the form y ~ <model terms>, where y is a network object or a matrix that can be coerced to a network object. For the details on the possible <model terms>, see ergm-terms. To create a network object in R, use the network() function, then add nodal attributes to it using the %v% operator if necessary.

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 theta0==NULL) or the identity (otherwise).

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. For simulate.formula, defaults to no constraints. For simulate.ergm, defaults to using the same constraints as those with which object was fitted.

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.


[Package ergm version 2.4-3 Index]