[statnet_help] Why no delete_edges() function in tergmLite?

b bzusman at gmail.com
Fri Nov 6 15:35:29 PST 2020


I'm relatively new to the tergmLite package and adapting code which
utilizes it to allow me to simulate on my personal computer, in combination
with the EpiModel library. Though I'd like to continue using the tergmLite,
our model requires some nodes to remain in existence while not forming
edges in the network ("off-shift"), in order to be reintroduced at a later
time step. We are trying to implement an "off-shift" module by changing the
nodal attribute "active" from 1 to 0, and then deleting the edges in the
edge list (el) involving these "inactive" nodes. The idea is to then
reintroduce nodes into the network with the rest of their retained nodal
attributes (updated accordingly) at a later time step. However, I notice
that tergmLite conspicuously lacks any functions to delete edges, while
there is a delete.edges() function in the network package, operating on
network objects rather than edge lists.
I suspect there's a good conceptual reason why tergmLite lacks functions to
delete edges from the edge list, while the network package has them. But I
don't see the reason clearly. Can someone explain?
Is designing a function to delete edges from el for our off-shift module a
fool's errand, in that we are simply short-circuiting tergmLite's speed
advantage? I don't want to reinvent tergm+networkDynamic here, and though I
realize their deactivate functions with a terminus argument offer some of
the functionality I want, I don't believe I need their full capability nor
do I have the computational resources to run them.

Looking for advice from those with more experience, both on whether/why
this path is inadvisable and if there are simpler alternatives I'm
overlooking.

-Benji Zusman
University of Florida

On Mon, Nov 2, 2020 at 3:05 PM <statnet_help-
request at mailman13.u.washington.edu> wrote:


> Send statnet_help mailing list submissions to

> statnet_help at u.washington.edu

>

> To subscribe or unsubscribe via the World Wide Web, visit

> http://mailman13.u.washington.edu/mailman/listinfo/statnet_help

> or, via email, send a message with subject or body 'help' to

> statnet_help-request at mailman13.u.washington.edu

>

> You can reach the person managing the list at

> statnet_help-owner at mailman13.u.washington.edu

>

> When replying, please edit your Subject line so it is more specific

> than "Re: Contents of statnet_help digest..."

> Today's Topics:

>

> 1. Modelling number of events and event size in bipartite

> network (Fisher, David)

>

>

>

> ---------- Forwarded message ----------

> From: "Fisher, David" <david.fisher at abdn.ac.uk>

> To: "statnet_help at u.washington.edu" <statnet_help at u.washington.edu>

> Cc:

> Bcc:

> Date: Mon, 2 Nov 2020 10:22:59 +0000

> Subject: [statnet_help] Modelling number of events and event size in

> bipartite network

>

> Hi folks,

>

> I posed this query in July, but thought I would ask again with code to

> perhaps demonstrate my problem a bit better.

>

>

> I've recently started playing around with modelling actor by event

> bipartite networks using "ergm". My first mode are actors with a single

> attribute, which is a 2-level factor (lets call it "class", with reds and

> blues), while my 2nd mode are events which have no attributes. I am

> interested in modelling 2 processes in a two-mode network that can lead to

> a higher degree in the projected one-mode network. Actors can get a higher

> one-mode degree by: 1) attending more events & 2) attending events attended

> by more others. I am interested in specifically modelling these two

> processes in the two-mode network so I don’t want to project to the

> one-mode then model a difference in degree.

>

> I am reasonably happy I get at 1) with ‘b1factor("class")’

>

> But right now I cannot work out how to model 2). I am certain that there

> is a term for it and I am just not understanding the documentation. I don't

> think it is "b2factor("class")" as events do not vary by class. I don't

> think it is any of the nodematch functions (e.g. "b1nodematch("class")") as

> I am not interested (for now) in whether reds attend events with other

> reds. I think I want to compare the number of two paths between the two

> groups, but I can't see a function to do that. Alternatively, perhaps you

> could frame it as a b2 k-star question, and does the number of different

> k-stars where the events are the central node depend on the class of those

> nodes that they are attached too. I’ve tried “b2starmix(2,"class", diff=T)”

> and this gives 2 different estimates for the different classes, which may

> allow one to say whether the 2 classes are similar in terms of the size of

> the event, but I am not sure. I have also wondered about adding the event

> degree as an attribute, and then seeing if reds or blues differ in their

> preference to connect with events differing in that attribute.

>

>

>

> Code recreating where I am at using the Davis Southern Women dataset here

> (I assume you can access the Davis dataset via statnet instead of tnet, but

> I haven’t been able to track down how; “data(davis)” doesn’t work for me:

>

>

>

> library(tnet)

>

> library(statnet)

>

>

>

> # Load Davis' (1940) Southern Women Dataset

>

> data(tnet)

>

>

>

> sw_ebi = as.matrix( table(Davis.Southern.women.2mode) ) #18 women (rows),

> 14 social events (columns)

>

>

>

> sw_bip = network(sw_ebi, bipartite = T)

>

>

>

> #randomly assign ‘class’ as “red” or “blue”. Code events as “black”

>

> sw_bip %v% "class" = c(sample(c("red","blue"), nrow(sw_ebi), replace=T),

> rep("black", ncol(sw_ebi)))

>

>

>

> plot(sw_bip, vertex.col = "class")

>

>

>

> #Fit Bipartite ERGM, model differences in number of connections between

> classes

>

> ergm_bip = ergm(sw_bip ~ edges +

>

> b1factor("class") ,

>

> reference=~Bernoulli)

>

>

>

> summary(ergm_bip) #so this is good, but I also want to model whether blues

> or reds attend larger events.

>

>

>

>

> Any help would be greatly appreciated.

>

> Best regards,

>

> David

>

>

>

> David N. Fisher

>

> he/him

>

> Research Fellow

>

> The School of Biological Sciences

>

> University of Aberdeen

>

> Web <https://evoetholab.com/> | GS

> <https://scholar.google.com/citations?user=1TuwKzQAAAAJ&hl=en> | Tw

> <https://twitter.com/DFofFreedom> | RG

> <https://www.researchgate.net/profile/David_Fisher30> | Or

> <https://orcid.org/0000-0002-4444-4450>

>

>

>

>

> The University of Aberdeen is a charity registered in Scotland, No

> SC013683.

> Tha Oilthigh Obar Dheathain na charthannas clàraichte ann an Alba, Àir.

> SC013683.

> _______________________________________________

> statnet_help mailing list

> statnet_help at mailman13.u.washington.edu

> http://mailman13.u.washington.edu/mailman/listinfo/statnet_help

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman13.u.washington.edu/pipermail/statnet_help/attachments/20201106/d04cf614/attachment.html>


More information about the statnet_help mailing list