ergm icon indicating copy to clipboard operation
ergm copied to clipboard

Can the underlying C structures represent non-square arrays?

Open gvegayon opened this issue 3 years ago • 3 comments

I've been working with Discrete Exponential Family Models (i.e., not necessarily ERGMs). For that reason (and for fun/learning, obviously), I've been putting a lot of effort into building a C++ template library that allows me to count sufficient stats in arrays with arbitrary dimensions--not necessarily square.

I have learned a lot from looking at the underlying C code in ERGM (thank you!), and now I wonder if there's a way I can use that to work with my non-square binary arrays.

PS: I'm sorry if I was supposed to post this on statnet_help; I figured that, b/c it deals with the underlying engine of ERGM, it would be more appropriate to ask here.

gvegayon avatar Jul 15 '21 19:07 gvegayon

The ERGM internals don't know anything about matrices; they only know about graphs. So anything that can be represented via a graph (possibly with constraints) can be represented that way; for instance, k-mode networks can be written in terms of a single network with attributes and block constraints (so long as your statistics are correctly defined). Not sure if that is practical for your application, but there is a lot of flexibility in it. I would note that ERGM (and many things in statnet, though not all) are designed with sparseness in mind, and thus can get bogged down in the large n' dense regime - so if you are dealing with non-sparse array data, this may not be the best way to handle it.

Hope that helps!

(BTW, this would indeed be better for the help list. But since it's here, it shall be answered!)

CarterButts avatar Jul 16 '21 03:07 CarterButts

BTW of motifs and graphlets, have you seen https://github.com/CarterButts/ergm.graphlets, @gvegayon ?

mbojan avatar Jul 19 '21 00:07 mbojan

I have not seen the ergm.graphlets before; @mbojan, thanks for the reference! The paper is indeed very relevant to what I am looking at.

@CarterButts, thanks for the quick reply! Good point about setting up constraints. I'd need to take a more detailed view of how to specify "arbitrary" constraints. Nonetheless, as you said, non-sparse data goes better with contiguous memory structures!

gvegayon avatar Jul 20 '21 19:07 gvegayon

@gvegayon , just checking in: has this issue been resolved to your satisfaction?

krivit avatar Apr 19 '24 04:04 krivit

Yes, @krivit, I'm good with it. Thanks for checking!

gvegayon avatar Apr 22 '24 15:04 gvegayon