# A multinomial receiver choice model
data("Social_Evolution")
callNetwork <- defineNetwork(nodes = actors, directed = TRUE)
callNetwork <- linkEvents(
x = callNetwork, changeEvent = calls,
nodes = actors
)
callsDependent <- defineDependentEvents(
events = calls, nodes = actors,
defaultNetwork = callNetwork
)
# \dontshow{
callsDependent <- callsDependent[1:50, ]
# }
mod01 <- estimate(callsDependent ~ inertia + recip + trans,
model = "DyNAM", subModel = "choice",
estimationInit = list(engine = "default_c")
)
summary(mod01)
# A individual activity rates model
mod02 <- estimate(callsDependent ~ 1 + nodeTrans + indeg + outdeg,
model = "DyNAM", subModel = "rate",
estimationInit = list(engine = "default_c")
)
summary(mod02)
# \donttest{
# A multinomial-multinomial choice model for coordination ties
data("Fisheries_Treaties_6070")
states <- defineNodes(states)
states <- linkEvents(states, sovchanges, attribute = "present")
states <- linkEvents(states, regchanges, attribute = "regime")
states <- linkEvents(states, gdpchanges, attribute = "gdp")
bilatnet <- defineNetwork(bilatnet, nodes = states, directed = FALSE)
bilatnet <- linkEvents(bilatnet, bilatchanges, nodes = states)
contignet <- defineNetwork(contignet, nodes = states, directed = FALSE)
contignet <- linkEvents(contignet, contigchanges, nodes = states)
createBilat <- defineDependentEvents(
events = bilatchanges[bilatchanges$increment == 1, ],
nodes = states, defaultNetwork = bilatnet
)
partnerModel <- estimate(
createBilat ~
inertia(bilatnet) +
indeg(bilatnet, ignoreRep = TRUE) +
trans(bilatnet, ignoreRep = TRUE) +
tie(contignet) +
alter(states$regime) +
diff(states$regime) +
alter(states$gdp) +
diff(states$gdp),
model = "DyNAM", subModel = "choice_coordination",
estimationInit = list(initialDamping = 40, maxIterations = 30)
)
summary(partnerModel)
# }
Run the code above in your browser using DataLab