Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

enformulate.curved

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

enformulate.curved(object, ...)

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

## S3 method for class 'formula'
enformulate.curved(object, theta, response = NULL, ...)

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.

...

Unused at this time.

theta

Curved model parameter configuration.

response

Name of the edge attribute whose value is to be modeled in the valued ERGM framework. Defaults to NULL for simple presence or absence, modeled via a binary ERGM.

Details

Because of a current kludge in ergm, output from one run cannot be directly passed as initial values (control.ergm(init=)) 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 control.ergm(init=).

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

Examples

data(sampson)
gest<-ergm(samplike~edges+gwesp(decay=.5, fixed=FALSE), 
    control=control.ergm(MCMC.burnin=1024, MCMC.interval=8, MCMLE.maxit=1))
# Error:
gest2<-try(ergm(gest$formula,
                control=control.ergm(init=coef(gest), MCMC.burnin=1024,
                                     MCMC.interval=8, MCMLE.maxit=1)))
print(gest2)

# Works:
tmp<-enformulate.curved(gest)
tmp
gest2<-try(ergm(tmp$formula,
                control=control.ergm(init=tmp$theta, MCMC.burnin=1024,
                                     MCMC.interval=8, MCMLE.maxit=1)))
summary(gest2)

ergm

Fit, Simulate and Diagnose Exponential-Family Models for Networks

v3.11.0
GPL-3 + file LICENSE
Authors
Mark S. Handcock [aut], David R. Hunter [aut], Carter T. Butts [aut], Steven M. Goodreau [aut], Pavel N. Krivitsky [aut, cre] (<https://orcid.org/0000-0002-9101-3362>), Martina Morris [aut], Li Wang [ctb], Kirk Li [ctb], Skye Bender-deMoll [ctb], Chad Klumb [ctb], Michał Bojanowski [ctb], Ben Bolker [ctb]
Initial release
2020-10-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.