How to model the GWESP Effect (and more) in Goldfish? #27
-
In Stadtfeld et al.'s (2017) introduction paper of DyNAM, They stated the following: "Higher order effects and effects that involve more than three nodes can be specified. These extend relational algebra to implicate further ties in dependencies. Examples include geometrically weighted edgewise shared partners’ effects (for a detailed discussion, see Snijders et al.2006) or attractiveness mechanisms such as preferential attachment." However, I have not seen the realization of gwesp or other higher-order effects in the goldfish package, on the rdrr.io page or the github page. I do appreciate that integrating every function into the package is massive work. However, I wonder if it is possible to estimate gwesp or other higher order effects with this version of Goldfish? Alternatively, is it possible to share some related codes so that I could learn how to write a customized effect estimation function myself, please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi Sam, I think this is a relevant question. I'm splitting my comments about it into two parts: GWESPThe geometrically weighted edgewise partners effects family is base on triadic effect as far I understand it. According to the Rsiena documentation (page 131), you can have five versions of the effect, which depends on the direction that you are interested in. From there, I think you can have a GWESP effect with a fixed α. For all value using the #' GWESP transformation of goldfish closure effects
#' A transformation function generator to compute GWESP as describe in RSiena manual
#'
#' Using closure idea from Advance R Wickham book,
#' it implements formula 19 (pg. 133) RSiena manual
#' @param alpha tuning parameter that may range from 0 to \infty, RSiena manual recommend a default value of log(2)
#' @param eventNetStat event network statistic that compute value $\sum_h x_{ih}{hj}$ in the case of GWESPFF
#'
#' @return transform statistic value
#' @noRd
#'
#' @examples
#' GWESPlog2 <- funTransformationGWESP(log(2))
#' GWESPlog2(0) # 0
#' GWESPlog2(1) # 1
#' GWESPlog2(6) # maximum slightly less than exp(log(2)), i.e., less than 2
funTransformationGWESP <- function(alpha) {
function(eventNetStat)
exp(alpha) * (1 - (1 - exp(-1 * alpha)) ^ eventNetStat)
}
# example of use
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)
GWESPFFlog2 <- funTransformationGWESP(log(2))
mod01 <- estimate(callsDependent ~ inertia + recip + trans(callNetwork, transformFun = funTransformationGWESP(log(2))),
model = "DyNAM", subModel = "choice")
summary(mod01)
I hope @stadtfeldethz or @jhollway could correct me if I'm wrong with this approach. According to the Rsiena documentation, you can have five versions of the GWESP effects. Right now,
The remaining problem is tunning the alpha parameter. For this, you can do a grid search and keep the model with better information criteria (a similar approach has been made for the size of the window for windowed effects). Higher-order effectsIf you have a specific effect in mind, I'm happy to help with the process. I'll prepare a vignette with a tutorial on developing new effects. In the meantime, you can take a look at the transitivity effect and the four effect as examples of effects involving three and four actors. Let me know if you need more info to proceed. I think I could put together an initial short raw version of the tutorial in a new discussion thread. |
Beta Was this translation helpful? Give feedback.
Hi Sam,
I think this is a relevant question. I'm splitting my comments about it into two parts:
GWESP
The geometrically weighted edgewise partners effects family is base on triadic effect as far I understand it. According to the Rsiena documentation (page 131), you can have five versions of the effect, which depends on the direction that you are interested in. From there, I think you can have a GWESP effect with a fixed α. For all value using the
transformFun
argument of some of the triadic effects implemented ingoldfish
. For example, the transitivity effect is the main component of what is used for the GWESPFF on formula 18a (Rsiena manual). The following code should do the trick:#' GW…