enformulate.curved {ergm}R Documentation

Convert a curved ERGM into a form suitable as initial values for the same ergm.

Description

The generic enformulate.curved converts an ergm object or formula of a model with curved terms to the variant in which the curved parameters embedded into the formula and are removed from the parameter vector. This is the form required by ergm calls.

Usage

## S3 method for class 'ergm'
enformulate.curved(object, ...)
## S3 method for class 'formula'
enformulate.curved(object, theta, ...)

Arguments

object

An ergm object or an ERGM formula. The curved terms of the given formula (or the formula used in the fit) must have all of their arguments passed by name.

theta

Curved model parameter configuration.

...

Unused at this time.

Details

Because of a current kludge in ergm, output from one run cannot be directly passed as initial values (theta0) for the next run if any of the terms are curved. One workaround is to embed the curved parameters into the formula (while keeping fixed=FALSE) and remove them from theta0.

This function automates this process for curved ERGM terms included with the ergm package. It does not work with curved terms not included in ergm.

Value

A list with the following components:

formula

The formula with curved parameter estimates incorporated.

theta

The coefficient vector with curved parameter estimates removed.

See Also

ergm, simulate.ergm

Examples

data(sampson)
gest<-ergm(samplike~edges+gwesp(alpha=.5,fixed=FALSE),maxit=1)
# Error:
gest2<-try(ergm(gest$formula,theta0=coef(gest),maxit=2))
print(gest2)

# Works:
tmp<-enformulate.curved(gest)
tmp
gest2<-try(ergm(tmp$formula,theta0=tmp$theta,maxit=2))
summary(gest2)

[Package ergm version 2.4-3 Index]