Learn R Programming

ergm (version 3.1.3)

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 target.stats vector.

Usage

## S3 method for class 'formula':
san(object, 
                      response=NULL, 
                      reference=~Bernoulli, 
                      constraints=~., 
                      target.stats=NULL,
                      nsim=1, 
                      basis=NULL,
                      sequential=TRUE,
                      control=control.san(),
                      verbose=FALSE, 
                      ...)
## S3 method for class 'ergm':
san(object, 
                   formula=object$formula, 
                   constraints=object$constraints, 
                   target.stats=object$target.stats,
                   nsim=1, 
                   basis=NULL,
                   sequential=TRUE, 
                   control=object$control$SAN.control,
                   verbose=FALSE, 
                   \dots)

Arguments

object
Either a formula or an ergm object. The formula should be of the form y ~ ,
response
EXPERIMENTAL. Name of the edge attribute whose value is to be modeled. Defaults to NULL for simple presence or absence.
reference
EXPERIMENTAL. One-sided formula whose RHS gives the reference measure to be used. (Defaults to ~Bernoulli.)
formula
(By default, the formula is taken from the ergm object. If a different formula object is wanted, specify it here.
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 and see
target.stats
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.
nsim
Number of desired networks.
basis
If not NULL, a network object used to start the Markov chain. If NULL, this is taken to be the network named in the formula.
sequential
Logical: If TRUE, the returned draws always use the prior draw as the starting network; if FALSE, they always use the original network.
control
A list of control parameters for algorithm tuning; see control.san.
verbose
Logical: If TRUE, print out more detailed information as the simulation runs.
...
Further arguments passed to other functions.

Value

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