Estimates parameters for a dynamic network model via maximum likelihood implementing the iterative Newton-Raphson procedure as describe in Stadtfeld and Block (2017).
estimate_dynam(
x,
sub_model = c("choice", "rate", "choice_coordination"),
data = NULL,
control_estimation = set_estimation_opt(),
control_preprocessing = set_preprocessing_opt(),
preprocessing_init = NULL,
preprocessing_only = FALSE,
progress = getOption("progress"),
verbose = getOption("verbose")
)
estimate_dynami(
x,
sub_model = c("choice", "rate"),
data = NULL,
control_estimation = set_estimation_opt(),
control_preprocessing = set_preprocessing_opt(),
preprocessing_init = NULL,
preprocessing_only = FALSE,
progress = getOption("progress"),
verbose = getOption("verbose")
)
estimate_rem(
x,
data = NULL,
control_estimation = set_estimation_opt(),
control_preprocessing = set_preprocessing_opt(),
preprocessing_init = NULL,
preprocessing_only = FALSE,
progress = getOption("progress"),
verbose = getOption("verbose")
)
a formula that defines at the left-hand side the dependent
network (see make_dependent_events()
) and at the right-hand side the
effects and the variables for which the effects are expected to occur
(see vignette("goldfishEffects")
).
A character string specifying the sub-model to be estimated.
It can be "rate"
to model the waiting times between events,
"choice"
to model the choice of the receiver, or "choice_coordination"
to model coordination ties. See details.
a multinomial receiver choice model estimate_dynam()
(Stadtfeld and Block, 2017).
A multinomial group choice model estimate_dynami()
(Hoffman et al., 2020)
a multinomial-multinomial model for coordination
ties estimate_dynam()
(Stadtfeld, Hollway and Block, 2017)
A individual activity rates model estimate_dynam()
(Stadtfeld and Block, 2017).
Two rate models, one for individuals joining groups and one for individuals
leaving groups, jointly estimated estimate_dynami()
(Hoffman et al., 2020)
a data.goldfish
object created with make_data()
.
It is an environment that contains the nodesets, networks,
attributes and dependent events objects. Default to NULL
.
An object of class control_estimation.goldfish
(typically created by set_estimation_opt()
),
specifying parameters for the estimation algorithm.
An object of class
control_preprocessing.goldfish
(typically created by
set_preprocessing_opt()
),
specifying parameters for data preprocessing. This is only used
if preprocessing_init
is not a preprocessed.goldfish
object or NULL.
an optional preprocessed object of class
preprocessed.goldfish
from a previous estimation. When it is provided,
the function will skip the preprocessing of the effects that are already
present in the object and only preprocess the new effects. Default to
NULL
.
logical. If TRUE
, the function will only run
the preprocessing stage and return an object of class
preprocessed.goldfish
. Default to FALSE
.
logical indicating whether should print a minimal output to the console of the progress of the preprocessing and estimation processes.
logical indicating whether should print very detailed intermediate results of the iterative Newton-Raphson procedure; slows down the routine significantly.
returns an object of class()
"result.goldfish"
when preprocessing_only = FALSE
or
a preprocessed statistics object of class "preprocessed.goldfish"
when preprocessing_only = TRUE
.
An object of class "result.goldfish"
is a list including:
a numeric vector with the coefficients estimates.
a numeric vector with the standard errors of the coefficients estimates.
the log-likelihood of the estimated model
a vector with the final score reach by the parameters during estimation.
a matrix with the final values of the negative Fisher information matrix. The inverse of this matrix gives the variance-covariance matrix for the parameters estimates.
a list with two elements.
The first element (isConverged
) is a logical value that indicates
the convergence of the model.
The second element (maxAbsScore
) reports the final maximum absolute
score in the final iteration.
an integer with the total number of iterations performed during the estimation process.
an integer reporting the number of events considered in the model.
a matrix with a description of the effects used for model fitting. It includes the name of the object used to calculate the effects and additional parameter description.
a formula with the information of the model fitted.
a character value of the model type.
a character value of the sub_model type.
a logical value indicating if the estimation process considered
right-censored events.
Only it is considered for estimate_dynam(x, sub_model = "rate")
or
REM (estimate_rem()
), when the model includes the intercept.
Missing data is handled during the preprocessing stage of the data. The specific imputation strategy depends on the type of data:
Network Data: Missing values in the initial network structure or in linked events that update network ties are imputed with a value of zero (0). This explicitly assumes the absence of a tie or event.
Attribute Covariates:
Initial Values: Missing values for the initial state of an attribute covariate are replaced by the mean value of that attribute across all actors.
During Event Updates (via linked events):
Using replace
: If a linked event uses the replace
variable
to specify a new attribute value and that value is missing, the missing
value is replaced by the mean of the attribute,
excluding the node being updated, at the moment of the event.
Using increment
: If a linked event uses the increment
variable to specify a change in attribute value and that increment is
missing, the missing value is imputed with a value of zero (0).
This assumes no change occurred.
Currently there are implemented the following models:
Dynamic Network Actor Models, estimate_dynam()
,
modeling a sequence of relational events as an actor-oriented process
(Stadtfeld, Hollway and Block, 2017 and Stadtfeld and Block, 2017)
Dynamic Network Actor Models for interactions,
estimate_dynami()
, modeling face-to-face interactions as an
actor oriented process
(Hoffman et al., 2020)
Relational Event Model, estimate_rem()
,
modeling a sequence of relational events as a tie-oriented process
(Butts, 2008).
The actor-oriented models that the goldfish package implements,
estimate_dynam()
, have been
called Dynamic Network Actor Models (DyNAMs).
The model is a two-step process. In the first step, the waiting time until
an actor \(i\) initiates the next relational event is modeled
(sub_model = "rate"
) by an exponential distribution depending on
the actor activity rate.
In the second step, the conditional probability of \(i\) choosing
\(j\) as the event receiver is modeled (sub_model = "choice"
)
by a multinomial probability distribution with a linear predictor.
These two-steps are assumed to be conditionally independent given
the process state (Stadtfeld, 2012),
due to this assumption is possible to estimate these components by
different calls of the estimate_dynam()
function.
When DyNAM-rate (estimate_dynam(x, sub_model = "rate")
) model
is used to estimate the first step component of the process, or the REM
estimate_rem(x, model = "REM")
model is used.
It is important to add a time intercept to model the waiting times between
events, in this way the algorithm considers the right-censored intervals
in the estimation process.
In the case that the intercept is not included in the formula. The model reflects the likelihood of an event being the next in the sequence. This specification is useful for scenarios where the researcher doesn't have access to the exact interevent times. For this ordinal case the likelihood of an event is merely a multinomial probability (Butts, 2008).
Butts C. (2008). A Relational Event Framework for Social Action. Sociological Methodology 38 (1). doi:10.1111/j.1467-9531.2008.00203.x
Hoffman, M., Block P., Elmer T., and Stadtfeld C. (2020). A model for the dynamics of face-to-face interactions in social groups. Network Science, 8(S1), S4-S25. doi:10.1017/nws.2020.3
Stadtfeld, C. (2012). Events in Social Networks: A Stochastic Actor-oriented Framework for Dynamic Event Processes in Social Networks. KIT Scientific Publishing. doi:10.5445/KSP/1000025407
Stadtfeld, C., and Block, P. (2017). Interactions, Actors, and Time: Dynamic Network Actor Models for Relational Events. Sociological Science 4 (1), 318-52. doi:10.15195/v4.a14
Stadtfeld, C., Hollway, J., and Block, P. (2017). Dynamic Network Actor Models: Investigating Coordination Ties Through Time. Sociological Methodology 47 (1). doi:10.1177/0081175017709295
# A DyNAM modeling rate and choice steps
data("Social_Evolution")
callNetwork <- make_network(nodes = actors, directed = TRUE)
callNetwork <- link_events(
x = callNetwork, change_event = calls,
nodes = actors
)
callsDependent <- make_dependent_events(
events = calls, nodes = actors,
default_network = callNetwork
)
DONTSHOW({
callsDependent <- callsDependent[1:50, ]
})
socialEvData <- make_data(callsDependent, callNetwork, call, actors)
mod01 <- estimate_dynam(callsDependent ~ inertia + recip + trans,
sub_model = "choice",
data = socialEvData,
control_estimation = set_estimation_opt(engine = "gather_compute")
)
summary(mod01)
# A individual activity rates model
mod02 <- estimate_dynam(callsDependent ~ 1 + node_trans + indeg + outdeg,
sub_model = "rate",
data = socialEvData,
control_estimation = set_estimation_opt(engine = "gather_compute")
)
summary(mod02)
# A REM
mod03 <- estimate_rem(
callsDependent ~ 1 + node_trans(callNetwork, type = "ego") +
indeg(callNetwork, type = "ego") + outdeg(callNetwork, type = "ego") +
inertia + recip + trans,
data = socialEvData,
control_estimation = set_estimation_opt(engine = "gather_compute")
)
summary(mod03)
# \donttest{
# A multinomial-multinomial choice model for coordination ties
data("Fisheries_Treaties_6070")
states <- make_nodes(states)
states <- link_events(states, sovchanges, attribute = "present")
states <- link_events(states, regchanges, attribute = "regime")
states <- link_events(states, gdpchanges, attribute = "gdp")
bilatnet <- make_network(bilatnet, nodes = states, directed = FALSE)
bilatnet <- link_events(bilatnet, bilatchanges, nodes = states)
contignet <- make_network(contignet, nodes = states, directed = FALSE)
contignet <- link_events(contignet, contigchanges, nodes = states)
createBilat <- make_dependent_events(
events = bilatchanges[bilatchanges$increment == 1, ],
nodes = states, default_network = bilatnet
)
fisheriesData <- make_data(
createBilat, contignet, bilatnet, contigchanges, bilatchanges,
states, sovchanges, regchanges, gdpchanges
)
partnerModel <- estimate_dynam(
createBilat ~
inertia(bilatnet) +
indeg(bilatnet, ignore_repetitions = TRUE) +
trans(bilatnet, ignore_repetitions = TRUE) +
tie(contignet) +
alter(states$regime) +
diff(states$regime) +
alter(states$gdp) +
diff(states$gdp),
sub_model = "choice_coordination",
data = fisheriesData,
control_estimation =
set_estimation_opt(
initial_damping = 40, max_iterations = 30,
engine = "default"
)
)
summary(partnerModel)
# }