ergm_state: A Representation of ERGM state

Description Usage Arguments Format Details Value Methods (by class) See Also

View source: R/ergm_state.R

Description

ergm_state is a family of semi-internal classes for passing around results of MCMC sampling, particularly when the result is used to start another MCMC sampler. It is deliberately loosely specified, and its structure and even name are subject to change.

Usage

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
ergm_state(x, ...)

## S3 method for class 'edgelist'
ergm_state(
  x,
  nw0,
  model = NULL,
  proposal = NULL,
  stats = NULL,
  ext.state = NULL,
  ...
)

## S3 method for class 'matrix'
ergm_state(
  x,
  nw0,
  model = NULL,
  proposal = NULL,
  stats = NULL,
  ext.state = NULL,
  ...
)

## S3 method for class 'network'
ergm_state(x, ...)

is.ergm_state(x)

## S3 method for class 'ergm_state'
as.edgelist(x, ...)

## S3 method for class 'ergm_state'
as.matrix(x, matrix.type = NULL, ...)

## S3 method for class 'ergm_state_full'
as.network(x, ..., populate = TRUE)

## S3 method for class 'ergm_state'
network.edgecount(x, na.omit = TRUE, ...)

## S3 method for class 'ergm_state_full'
network.dyadcount(x, na.omit = TRUE, ...)

## S3 method for class 'ergm_state_full'
network.size(x, ...)

## S3 method for class 'ergm_state'
network.naedgecount(x, ...)

## S3 method for class 'ergm_state_full'
lhs %ergmlhs% setting

## S3 method for class 'ergm_state_full'
lhs %ergmlhs% setting <- value

## S3 method for class 'ergm_state'
as.rlebdm(x, ...)

## S3 method for class 'ergm_state_send'
as.ergm_model(x, ...)

## S3 method for class 'ergm_state_send'
is.curved(object, ...)

## S3 method for class 'ergm_state_send'
param_names(object, ...)

## S3 method for class 'ergm_state_send'
nparam(object, ...)

## S3 method for class 'ergm_state_full'
update(
  object,
  el = NULL,
  nw0 = NULL,
  model = NULL,
  proposal = NULL,
  stats = NULL,
  ext.state = NULL,
  state = NULL,
  ...
)

## S3 method for class 'ergm_state'
ergm_state(x, model = NULL, proposal = NULL, stats = NULL, ...)

ERGM_STATE_R_CHANGED

ERGM_STATE_C_CHANGED

ERGM_STATE_RECONCILED

ergm_state_send(x, ...)

## S3 method for class 'ergm_state_send'
ergm_state_send(x, ...)

## S3 method for class 'ergm_state_full'
ergm_state_send(x, ...)

## S3 method for class 'ergm_state_send'
update(object, state, ...)

ergm_state_receive(x, ...)

## S3 method for class 'ergm_state'
ergm_state_receive(x, ...)

## S3 method for class 'ergm_state_full'
ergm_state_receive(x, ...)

## S3 method for class 'ergm_state'
summary(object, ...)

Arguments

...

Additional arguments, passed to further methods.

nw0

a network object, whose edges are absent or ignored.

model

an ergm_model object.

ext.state

a list equal to the number of terms in the model, providing the encoded extended state. This vector is usually generated by ext.encode() function of an ergm term, but it can be specified directly.

na.omit

Whether missing edges should be counted. Note that missing edge information is not stored.

state

An ergm_state to replace the state with.

nw

a network object.

Format

An object of class integer of length 1.

An object of class integer of length 1.

An object of class integer of length 1.

Details

ergm_state is actually a hierarchy of classes, defined by what they can be used for. Specifically,

c(ergm_state_receive,ergm_state)

needs to contain only el, ext.state, and ext.flag: it is the information that can change in the process of MCMC sampling; it is the one returned by the *_slave functions, to minimize the amount of data being sent between nodes in parallel computing.

c(ergm_state_send,ergm_state_receive,ergm_state)

needs the above but also the model and the proposal: is needed to initiate MCMC sampling; it is the information required by the *_slave functions, again, to minimize the amount of data being sent between nodes in parallel computing.

c(ergm_state_full, ergm_state_send,ergm_state_receive,ergm_state)

needs the above but also the nw0: is needed to reconstruct the original network.

Value

At this time, an ergm_state object is (subject to change) a list containing some subset of the following elements, with el, ext.state, and ext.flag mandatory and others depending on how it is used:

el

a tibble edgelist representing the edge state of the network

nw0

a network object with all edges removed.

model

an ergm_model object.

proposal

an ergm_proposal object.

ext.state

a list of length equalling to the number of terms in the model.

ext.flag

one of ERGM_STATE_R_CHANGED, ERGM_STATE_C_CHANGED, and ERGM_STATE_R_RECONCILED.

stats

a numeric vector of network statistics or some other statistics used to resume.

Methods (by class)

See Also

ergm_MCMC_sample() for an example of manually constructing and manipulating an ergm_state.


ergm documentation built on July 27, 2021, 5:07 p.m.