R: Storing last toggle information in a network

lasttoggle {ergm} | R Documentation

## Storing last toggle information in a network

### Description

An informal extension to `network` objects allowing some limited temporal information to be stored. WARNING: THIS DOCUMENTATION IS PROVIDED AS A COURTESY, AND THE API DESCRIBED IS SUBJECT TO CHANGE WITHOUT NOTICE, DOWN TO COMPLETE REMOVAL. NOT ALL FUNCTIONS THAT COULD SUPPORT IT DO. USE AT YOUR OWN RISK.

### Usage

    ergm.el.lasttoggle(nw)

    to.matrix.lasttoggle(nw)

    to.lasttoggle.matrix(m, directed = TRUE, bipartite = FALSE)

### Arguments

`nw` | the network, otpionally with a `"lasttoggle"` network attribute.
`m` | a sociomatrix of appropriate dimension (rectangular for bipartite networks).
`directed, bipartite` | whether the matrix represents a directed and/or a bipartite networks.

### Details

While `networkDynamic` provides a flexible, consistent method for storing dynamic networks, the `C` routines of `ergm` and `tergm` required a simpler and more lightweight representation.

This representation consisted of a single integer representing the time stamp and an integer vector of length to `network.dyadcount(nw)` — the number of potential ties in the network, giving the last time point during which each of the dyads in the network had changed.

Though this is an API intended for internal use, some functions, like `stergm` (for EGMME), `simulate`, and `summary` can be passed networks with this information using the following `network` (i.e., `%n%`) attributes:

list("time")

  the time stamp associated with the network

list("lasttoggle")

  a vector of length `network.dyadcount(nw)`, giving the last change time associated with each dyad. See the source code of `ergm` internal functions `to.matrix.lasttoggle`, `ergm.el.lasttoggle`, and `to.lasttoggle.matrix` for how they are serialized.

For technical reasons, the `tergm` routines treat the `lasttoggle` time points as shifted by -1.

Again, this API is subject to change without notice.

### Functions

- `ergm.el.lasttoggle`: Returns a 3-column matrix whose first two columns are tails and heads of extant edges and whose third column are the creation times for those edges.

- `to.matrix.lasttoggle`: Returns a numeric sociomatrix whose values are last toggle times for the corresponding dyads.

- `to.lasttoggle.matrix`: Serializes a matrix of last toggle times into the form used by C code.

[Package ergm version 3.10.4 Index]