rem.dyad
fits a (dyadic) relational event model to an event sequence, using either the full temporal or ordinal data likelihoods. Three estimation methods are currently supported: maximum likelihood estimation, Bayesian posterior mode estimation, and Bayesian sampling importance resampling. For the Bayesian methods, an adjustable multivariate-t (or, if prior.nu==Inf
, Gaussian) prior is employed. In the case of Bayesian sampling importance resampling, the posterior mode (and the hessian of the posterior about it) is used as the basis for a multivariate-t sample, which is then resampled via SIR methods to obtain an approximate set of posterior draws. While this approximation is not guaranteed to work well, it is generally more robust than pure mode approximations (or, in the case of the MLE, estimates of uncertainty derived from the inverse hessian matrix).
Whether Bayesian or frequentist methods are used, the relevant likelihood is either based entirely on the order of events (ordinal=TRUE
) or on the realized event times (ordinal=FALSE
). In the latter case, all event times are understood to be relative to the onset of observation (i.e., observation starts at time 0), and the last event time given is taken to be the end of the observation period. (If an event is also specified, this event is ignored.)
Effects to be fit by rem.dyad
are determined by the eponymous effects
argument, a character vector which lists the effects to be used. These are as follows:
NIDSnd
: Normalized indegree of \(v\) affects \(v\)'s future sending rate
NIDRec
: Normalized indegree of \(v\) affects \(v\)'s future receiving rate
NODSnd
: Normalized outdegree of \(v\) affects \(v\)'s future sending rate
NODRec
: Normalized outdegree of \(v\) affects \(v\)'s future receiving rate
NTDegSnd
: Normalized total degree of \(v\) affects \(v\)'s future sending rate
NTDegRec
: Normalized total degree of \(v\) affects \(v\)'s future receiving rate
FrPSndSnd
: Fraction of \(v\)'s past actions directed to \(v'\) affects \(v\)'s future rate of sending to \(v'\)
FrRecSnd
: Fraction of \(v\)'s past receipt of actions from \(v'\) affects \(v\)'s future rate of sending to \(v'\)
RRecSnd
: Recency of receipt of actions from \(v'\) affects \(v\)'s future rate of sending to \(v'\)
RSndSnd
: Recency of sending to \(v'\) affects \(v\)'s future rate of sending to \(v'\)
CovSnd
: Covariate effect for outgoing actions (requires a covar
entry of the same name)
CovRec
: Covariate effect for incoming actions (requires a covar
entry of the same name)
CovInt
: Covariate effect for both outgoing and incoming actions (requires a covar
entry of the same name)
CovEvent
: Covariate effect for each \((v,v')\) action (requires a covar
entry of the same name)
OTPSnd
: Number of outbound two-paths from \(v\) to \(v'\) affects \(v\)'s future rate of sending to \(v'\)
ITPSnd
: Number of incoming two-paths from \(v'\) to \(v\) affects \(v\)'s future rate of sending to \(v'\)
OSPSnd
: Number of outbound shared partners for \(v\) and \(v'\) affects \(v\)'s future rate of sending to \(v'\)
ISPSnd
: Number of inbound shared partners for \(v\) and \(v'\) affects \(v\)'s future rate of sending to \(v'\)
FESnd
: Fixed effects for outgoing actions
FERec
: Fixed effects for incoming actions
FEInt
: Fixed effects for both outgoing and incoming actions
PSAB-BA
: P-Shift effect (turn receiving) -- AB->BA (dyadic)
PSAB-B0
: P-Shift effect (turn receiving) -- AB->B0 (non-dyadic)
PAAB-BY
: P-Shift effect (turn receiving) -- AB->BY (dyadic)
PSA0-X0
: P-Shift effect (turn claiming) -- A0->X0 (non-dyadic)
PSA0-XA
: P-Shift effect (turn claiming) -- A0->XA (non-dyadic)
PSA0-XY
: P-Shift effect (turn claiming) -- A0->XY (non-dyadic)
PSAB-X0
: P-Shift effect (turn usurping) -- AB->X0 (non-dyadic)
PSAB-XA
: P-Shift effect (turn usurping) -- AB->XA (dyadic)
PSAB-XB
: P-Shift effect (turn usurping) -- AB->XB (dyadic)
PSAB-XY
: P-Shift effect (turn usurping) -- AB->XY (dyadic)
PSA0-AY
: P-Shift effect (turn continuing) -- A0->AY (non-dyadic)
PSAB-A0
: P-Shift effect (turn continuing) -- AB->A0 (non-dyadic)
PSAB-AY
: P-Shift effect (turn continuing) -- AB->AY (dyadic)
Note that not all effects may lead to identified models in all cases - it is up to the user to ensure that the postulated model makes sense.
Data to be used by rem.dyad
must consist of an edgelist matrix, whose rows contain information on successive events. This matrix must have three columns, containing (respectively) the event times, sender IDs (as integers from 1 to n
), and receiver IDs (also from 1 to n
). As already noted, event times should be relative to onset of observation where the temporal likelihood is being used; otherwise, only event order is employed. In the temporal likelihood case, the last row should contain the time for the termination of the observation period -- any event on this row is ignored. If conditioned.obs>0
, the relevant number of initial observations is taken as fixed, and the likelihood of the remaining sequence is calculated conditional on these values; this can be useful when analyzing an event history with no clear starting point.
If covariates effects are indicated, then appropriate covariate values must be supplied as a list in argument covar
. The elements of covar
should be given the same name as the effect type to which they correspond (e.g., CovSnd
, CovRec
, etc.); any other elements will be ignored. The format of a given covariate element depends both on the effect type and on the number of covariates specified. The basic cases are as follows:
Single covariate, time invariant: For CovSnd
, CovRec
, or CovInt
, a vector or single-column matrix/array. For CovEvent
, an n
by n
matrix or array.
Multiple covariates, time invariant: For CovSnd
, CovRec
, or CovInt
, a two-dimensional n
by p
matrix/array whose columns contain the respective covariates. For CovEvent
, a p
by n
by n
array, whose first dimension indexes the covariate matrices.
Single or multiple covariates, time varying: For CovSnd
, CovRec
, or CovInt
, an m
by p
by n array whose respective dimensions index time (i.e., event number), covariate, and actor. For CovEvent
, a m
by p
by n
by n
array, whose dimensions are analogous to the previous case.
Note that “time varying” covariates may only change values when events transpire; thus, they should be regarded as temporally endogenous. (See the reference below for details.)
If called with edgelist==NULL
, rem.dyad
will produce a “model skeleton” object containing the effects and other information, but no model fit. (The seed coefficients, if given, are entered as the coefficients in the model, or else an uninteresting default set is used.) The main purpose for this object is to set up an ab initio simulation, as described below: once the skeleton is created, the simulate
method can be used to generate draws from that model (without fitting to a data set).
A simulate
method is provided for rem.dyad
objects, which allows simulation of new event sequences from a fitted or skeleton model. By default, a new sequence of length equal to the original sequence to which the model object was fitted is simulated (if applicable), but other lengths may be chosen using nsim
. Although the coefficients in the model object are used by default, this may also be altered by specifying coef
. Note that any covariates used must be passed to the simulate command via covar
(using the same format as in the original model); this is in part because rem.dyad
objects do not currently save their input data, and in part because dynamic covariates must always be the length of the simulated sequence (and hence must be factored when a non-default nsim
value is used). For models fit using ordinal=TRUE
, the overall pacing of events will be arbitrary (more specifically, the simulation will tacitly assume that each event has a unit base hazard), but the relative timing is not. See below for examples of both simulation using a fitted model object and ab initio simulation without fitting a model to data.
For simulation, it is possible to fix the first portion of the event history by passing an event list matrix to the edgelist
argument; this must be compatible with the target model (i.e., the vertex IDs must match), and it cannot contain NA
values. (Thus, if starting with an exact timing seqence with a last line containing NA
s, this must be removed.) If the input event list contains m
events, then these are assumed to supply the first m
events of the target sequence; if m>nsim
, then any excess events are discarded. By default, the input events are taken as fixed. However, specifying redraw.timing=TRUE
will lead the event timings to be redrawn, and redraw.events
will lead the sender/reciver pairs to be redrawn. This allows e.g. for an observed ordinal time sequence to be given a simulated exact time realization, by setting nsim
to the event list length and setting redraw.timing=TRUE
. The more obvious use case is to simply extend an observed sequence, in which case one should use nsim
greater than the input sequence length (i.e., the input length plus the number of new events to generate) and leave the redraw
paraeters set to FALSE
.