R: Wrap a submodel's curved, empty network statistics, and...

wrap.ergm_model {ergm} | R Documentation

## Wrap a submodel's curved, empty network statistics, and extended state (read-only) specification (if present) for output from an `InitErgmTerm` or `InitWtErgmTerm`.

### Description

Given a `ergm` model and (optionally) a function with which to wrap parameter names, wrap the calls to its `ergm.eta()` and `ergm.etagrad()` into `map()` and `gradient()` functions, similarly with the `params` element; wrap empty network statistics; wrap indicator of dyadic independence; and wrap offset indicators.

### Usage

    wrap.ergm_model(m, nw, namewrap = identity)

### Arguments

`m` | An `ergm_model` object.
`nw` | A `network` object.
`namewrap` | An optional function taking a character vector and returning a character vector of the same length, called on the model's canonical and curved parameter names to wrap them. Set to `NULL` for auxiliary terms to avoid generating elements not relevant to auxiliaries.

### Value

a list with elements `map`, `gradient`, `params`, `emptynwstats`, `dependence`, `offsettheta`, and `offsetmap`, suitable for concatenating with an `InitErgmTerm` or `InitWtErgmTerm` output list (possibly after modification).

[Package ergm version 4.1.2 Index]